Help with ladder logic

Discussion in 'Programmer's Corner' started by Bm1323, Jul 5, 2012.

  1. Bm1323

    Thread Starter New Member

    Jul 5, 2012
    1
    0
    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.
     
  2. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    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.
     
Loading...