Sign in to follow this  
Followers 0
Guest merico

CS1 and floating point

1 post in this topic

CS1 with CX-Programmer lacks floating point constants in the ladder programming. CS1G with CX-Programmer lacks floating point comparations, like >, <, =, etc ... CS1H CPU has floating point comparations. I suggest a way for avoid the first missing feature: - Monitorize the value of a pair or unused 16 bits words register as floating point variable, for example D0 and D1, and set the value to the constant number you want, you must introduce the value in scientific notation like 2e+2 to set 200 because a possible bug in Cx-Programmer makes that it does not understand 200 without an exponent. Then switch to monitorize as 16 hexadecimal and note the values for both words, for example if you read D0 = 8765 and D1 = 4321 then you need to put #43218765 in your ladder as the floating point constant. I have not tested that way for double floating point (64 bit) I suggest a way too for the comparation lack: - We want to compare Op1 with Op2. Substract with floating point instruccion and put the result in Op3 like this: Op3 = Op1 - Op2 then test if bit 31 of Op3 is set, if it's 1 then Op1 is less than Op2, else if it's not set then Op1 is equal or greater than Op2, if you are using for example D0 as Op3 then you must test bit 15 in D1. It's hard to believe that the top OMRON PLC has those missing features. Regards. merico.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0