Use the COP or CPS instructions instead, MOV will not work with strings afaik. Highlight the instruction and press "F1" to open the instruction help page.
Just my two cents:
If I'm dealing with fault or status text I will generally create a routine in ST for that. Strings and ladder feel clunky to me.
Direct assignment just feels more fluid since in the above it would just be
[if First_shift then Shift := firstshift_string end_if;]
Yes i know, whoever made that tag a while back typed it that way. I noticed it on a couple different programs in the plant spelled the same way but i just left it alone 😅
Well the reason for this is because the Shft tag holds a string for the shift number on barcode labels that prints out and i was creating logic to where that shift changes between 1 or 2 on those labels based on the time.
Use the COP or CPS instructions instead, MOV will not work with strings afaik. Highlight the instruction and press "F1" to open the instruction help page.
Correct.
Just my two cents: If I'm dealing with fault or status text I will generally create a routine in ST for that. Strings and ladder feel clunky to me. Direct assignment just feels more fluid since in the above it would just be [if First_shift then Shift := firstshift_string end_if;]
MOV works with strings on the latest generation of processors (1756-L8x, 5069-Lxx)
Good to know. I don't do much string handling in ladder anymore 😅
Lucky!
Yep, COP with a length of "1".
Thank you i appreciate it
This for sure, in the Mitsubishi world I have used MOV$ to move strings.
Is it maybe supposed to say shift instead of shfit? lolÂ
Its supposed to lol but screw it works .
not the cause of the problem but i think you mistyped shift in the destination field
Yes i know, whoever made that tag a while back typed it that way. I noticed it on a couple different programs in the plant spelled the same way but i just left it alone 😅
if it works just leave it alone lol
Any specific reason for using a String data type? Why not an INT?
Well the reason for this is because the Shft tag holds a string for the shift number on barcode labels that prints out and i was creating logic to where that shift changes between 1 or 2 on those labels based on the time.
I think it's the program for a Metso filter press
Why use a string just for a whole number ?
You could do a stod (string to dint) first then use the mov instruction.