Brandon_K
Member
Hey guys. I have a situation where I need to compare a dynamic data value to a static value, then take the greater of the two and use that in my program.
I have some math which creates DATA_SCORE, which is then repacked into a string (DATA_SCORE_LCD) that is displayed on the PLC and HMI.
What I need to do is compare DATA_SCORE against "90". If the value is greater than 90, then I want to repack DATA_SCORE into DATA_SCORE_LCD string. If it's less than or equal to 90, then I want 90 packed into DATA_SCORE_LCD. So basically, at no point will the LCD/HMI ever display lower than 90.
I've played with the Compare Values instruction, but it doesn't look like I can copy the data from DATA_SCORE into a new memory location, it would only set a bit.
I'm using a Productivity2k.
I have some math which creates DATA_SCORE, which is then repacked into a string (DATA_SCORE_LCD) that is displayed on the PLC and HMI.
What I need to do is compare DATA_SCORE against "90". If the value is greater than 90, then I want to repack DATA_SCORE into DATA_SCORE_LCD string. If it's less than or equal to 90, then I want 90 packed into DATA_SCORE_LCD. So basically, at no point will the LCD/HMI ever display lower than 90.
I've played with the Compare Values instruction, but it doesn't look like I can copy the data from DATA_SCORE into a new memory location, it would only set a bit.
I'm using a Productivity2k.