Help with ladder logic

Thread Starter

Bm1323

Joined Jul 5, 2012
1
This might be a simple solution but i am new at working with plcs. I am writing ladder logic to scan bar codes and sort boxes. We are using a cognex scanner to scan the bar codes. When we recieve the numbers on rs logixs its the right number but has parentheses around it. For example '1'. Therefore i am not able to use it in a compare command and i recieve an error. I believe it is because it is SINT. Is there some way to covert it to BOOL? Hopefully this makes sense to someone who can help me out.
 

GetDeviceInfo

Joined Jun 7, 2009
2,196
This might be a simple solution but i am new at working with plcs. I am writing ladder logic to scan bar codes and sort boxes. We are using a cognex scanner to scan the bar codes. When we recieve the numbers on rs logixs its the right number but has parentheses around it. For example '1'. Therefore i am not able to use it in a compare command and i recieve an error. I believe it is because it is SINT. Is there some way to covert it to BOOL? Hopefully this makes sense to someone who can help me out.
what is the format of the 'numbers' you are recieving. A bracketed number indicates a negative value, indicating your high bit is set (likely overrunning). You might as well jump right up to a DINT. There are a number of compare instructions that produce a BOOL result.
 
Top