skyfox

Can a integer tag be addressed at bit level?

9 posts in this topic

NX1P2 / SYSMAC Studio (latest version)

 

Say I have an integer tag named "CMD" Is there a way to use the individual bits of that integer in Logic with Sysmac?

      CMD.00

--------|  |-----------

 

 

Share this post


Link to post
Share on other sites

Sysmac doesn't do bits like other platforms. The easiest with to accomplish this is with CJ Series Memory addressing. Make a bool[16] array and assign the same address and the bits will reflect the contents

Capture.JPG

1 person likes this

Share this post


Link to post
Share on other sites
36 minutes ago, photovoltaic said:

Sysmac doesn't do bits like other platforms. The easiest with to accomplish this is with CJ Series Memory addressing. Make a bool[16] array and assign the same address and the bits will reflect the contents

Capture.JPG

Thank You.

In that case do I still need the integer declaration? Instead, could I just use tag "CMD" with a data type of  "ARRAY[0...15] OF BOOL" with %D0 AT designation directly?

Share this post


Link to post
Share on other sites

If you don't need to use it as an integer yes. But if this is the case you may as well not bother addressing it with AT at all and just use bits or a BOOL array. Using the address is only for the purpose of bit extraction in this case - like when you receive a status word from a device and need to pick out the bits.

Share this post


Link to post
Share on other sites
46 minutes ago, photovoltaic said:

If you don't need to use it as an integer yes. But if this is the case you may as well not bother addressing it with AT at all and just use bits or a BOOL array. Using the address is only for the purpose of bit extraction in this case - like when you receive a status word from a device and need to pick out the bits.

I Was under the impression AT designation was needed for NB Series HMI to exchange data with an NX1P2.

Share this post


Link to post
Share on other sites
19 minutes ago, skyfox said:

I Was under the impression AT designation was needed for NB Series HMI to exchange data with an NX1P2.

Yes, in this case you can treat it as an integer on the NB and address a BOOL[16] array in the PLC.

Share this post


Link to post
Share on other sites
47 minutes ago, photovoltaic said:

Yes, in this case you can treat it as an integer on the NB and address a BOOL[16] array in the PLC.

I realize I need both the integer and the bit format for what I am wanting to do. Suppose I have the need for this functionality (resolving bits from an integer) just in the NX1P2 without involving the NB HMI. I don't see a way around without using  AT designation and without using CJ-Series memory. Does NB HMI read all CJ-Series tags with a AT designation from Global variables, or just the TAGS that are referenced  within the HMI program?

Thanks again for the help.

Cheers.

 

Edited by skyfox

Share this post


Link to post
Share on other sites
37 minutes ago, skyfox said:

I realize I need both the integer and the bit format for what I am wanting to do. Suppose I have the need for this functionality (resolving bits from an integer) just in the NX1P2 without involving the NB HMI. I don't see a way around without using  AT designation and without using CJ-Series memory. Does NB HMI read all CJ-Series tags with a AT designation from Global variables, or just the TAGS that are referenced  within the HMI program?

Thanks again for the help.

Cheers.

 

There is another way to extract bits in Sysmac using a Union datatype but I find the addresses easier.

The HMI will only read/write tags specified in the HMI application

Share this post


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

There is another way to extract bits in Sysmac using a Union datatype but I find the addresses easier.

The HMI will only read/write tags specified in the HMI application

Great. Thank you.

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