pabspagg Posted August 10, 2020 Report Posted August 10, 2020 (edited) Hello! I am trying to copy a part of a structure to an array. This is how my structure looks like: The variable that contains the structure: I want to move only the first variable ("nome") to an array of strings. I tried move, arymove, memcopy, left,mid ,right, everything I could think of. But nothing worked. I think the problem is the string was typed in the nb designer IHM and saved on the plc. But what NB designer does when u type a string? Is it converted? I did a test and this is how it looks: The first part (Receitas[1].nome) was typed on the NB designer and the instruction move doesn´t work. The second one I forced the value on plc and it worked. What am I missing here? Thank you! Edited August 10, 2020 by pabspagg
chelton Posted August 10, 2020 Report Posted August 10, 2020 I can't see where you are using the variable ARRAY_RECEITAS ? is that ladder screenshot in a function block? It looks like you may have declared 2 variable arrays 1 called RECEITAS and another called ARRAY_RECEITAS
pabspagg Posted August 11, 2020 Author Report Posted August 11, 2020 (edited) 1 hour ago, chelton said: I can't see where you are using the variable ARRAY_RECEITAS ? is that ladder screenshot in a function block? It looks like you may have declared 2 variable arrays 1 called RECEITAS and another called ARRAY_RECEITAS Sorry. I have a function block which takes Receitas -> ARRAY_RECEITAS(Input from the fuction block). I should have printed outside the function block! I think the problem it's about typing the string in the NB designer. When I do and goes to plc (Receitas[X].nome), maybe it's not a string at all? Maybe array of words? Not sure though. If I force a string in the structure, I can copy easily. But if I get the string from the NB Designer I wasn't able copy it. If I'm not clear , just tell me. I will try to explain a better way. Edited August 11, 2020 by pabspagg
pabspagg Posted August 11, 2020 Author Report Posted August 11, 2020 Well, I have just found out a document which explains what's happening. I will test tomorrow if It works! Using_STRING_with_NB_HMI_and_NJ.pdf
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now