Jump to content

Recommended Posts

Posted

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? 

  • Like 1
Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...