1. We will be in Read Only mode (no new threads, replies, registration) starting at 9:00 EDT for a number of hours as we migrate the forums to upgraded software.

Help with ladder logic

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

  1. Bm1323

    Thread Starter New Member

    Jul 5, 2012
    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

    AAC Fanatic!

    Jun 7, 2009
    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.