Sign in to follow this  
Followers 0
AngryRobot

Writing/Reading Word Values As Addresses?

3 posts in this topic

I've been using CX-Programmer since I got started in the automation industry a few years ago; so while I'm no expert with CX I can usually figure out a way around the road blocks I hit.  Sysmac is a whole new beast for me.  I really don't like IEC style programming; I like addresses- though that is probably just from a lack of experience.  I've only had a bit of training (read: one day) with TIA Portal; and I've written a few programs with Proface's GP-ProEX. 

I now have a customer that is using an NJ plc on a machine in place of a CJ2 that was on the first one we built.  So I'm in the process of basically rewriting the whole program in Sysmac; but I'm used to using a lot of quick and dirty functions that I can no longer use.  For example I'm used to being able to use the bits of a word as Boolean outputs; and have those bits modify the value of the word to accomplish something else.   Here is a quick example:

W100.00 (Fault 1) Energizes.

 IF W100>0 THEN:

          Energize W200.00 (Fault Exists)

 

Hope that makes sense.  Basically if a bit within W100 comes on then there is a fault and I can use the value of W100 being greater than 0 to energize the primary fault coil.

 

That allows me to have a bit by the individual fault to activate a message on the touch screen; but it also allows me to activate the main fault coil without having to put everyone of the bits in a huge parallel branch.

 

I know I could just use an INT tag and write a number to it for each fault; but I still need an individual address to trigger the alarm message on the NS screen.  Is there a way to accomplish this without having to write a bit and a move statement for each fault? 

1 person likes this

Share this post


Link to post
Share on other sites

Well, I guess I should have read some of the posts that I opened in another tab before I submitted my question.  It appears I need to use a union.

Share this post


Link to post
Share on other sites
57 minutes ago, AngryRobot said:

Well, I guess I should have read some of the posts that I opened in another tab before I submitted my question.  It appears I need to use a union.

Yes.  You can accomplish exactly what you want using a union.

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