omi jha

What is the Use of Number data type for CJ2 Omron PLC?

6 posts in this topic

What is the Use of Number data type for CJ2 Omron PLC? it takes integers as well as float values .

we can not map it to D or H memory area.

Share this post


Link to post
Share on other sites

You cannot use an address for NUMBER. It is intended for literal values only. The number type will be determined by the method in which you precede the constant value. (#, &, +, -).  A REAL value will be preceded by a "+" or "-" and contain a ".".

Share this post


Link to post
Share on other sites

In other words, a Number type data is a named constant.

Share this post


Link to post
Share on other sites
20 minutes ago, Sergei Troizky said:

In other words, a Number type data is a named constant.

Simply stated. ;-)

Share this post


Link to post
Share on other sites

I am interested in use cases rather than the definition of Number. What is the use when we want to read or write to the plc memory  using ethernet/ip ? Hope I am clear .

Share this post


Link to post
Share on other sites
1 hour ago, omi jha said:

I am interested in use cases rather than the definition of Number. What is the use when we want to read or write to the plc memory  using ethernet/ip ? Hope I am clear .

It really has nothing to do with EtherNet/IP.  It is just a way to put a symbol on a constant for documentation purposes.  I never use this functionality, but rather comment the code and the rung around the constant so that the meaning of the constant is clear.  

In the rung below, I move a constant of 5 (UINT) into D100.  D100 could then be part of the implicit messaging communications of EtherNet/IP if you set it up to do so (as an example):

number.thumb.jpg.d9fb980a6de6445fe645eb7

 

Here is the definition of the constant in the symbol table:

5a905761de36b_numbersymbol.jpg.82118370b

One other use for this is that you could use the name to program rather than the constant value itself.  So, if you had a more complicated constant that you might not remember, you could use this to enter your command.  Example (if you did not remember what pi's value was):

Creation of pi symbol:

5a90588f6a1a7_pisymbol.jpg.ad663eda999f0

Programming using the symbol name:

5a90588ef0b8d_piprogramming.jpg.5da117d2

End result (area calculation):

5a90588e9424d_areacalc.jpg.d790d75019dfc

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