Sign in to follow this  
Followers 0
Tigamaroo1999

Active background response

12 posts in this topic

I am programming a CJ1M-CPU22 PLC and an NS5 touchpanel. What I have is a counter that counts down the number of coils in a machine. When it gets to zero, I need a "Material Finished" screen to pop up. The problem that I'm having is trying to figure out what command to use. When the coil count goes to zero, I momentarily set bit 800.00 on. I want to use this bit to switch screens on the touchpanel. Problem is, the macro execution is only when a screen loads, or when a button is touched, etc. Is there a way that I can use bit 800.00 to switch screens on the touchpanel? Thanks in advance! Tigamaroo

Share this post


Link to post
Share on other sites
I am a weiner. -Homer Simpson Sometimes you're the dog, other times your the hydrant. Tigamaroo P.S. The above references mean that I figured it out, and it was really easy.

Share this post


Link to post
Share on other sites
Just so we can assist later on, are you using the system bits internally to the NS or are they addressed somewhere in the PLC?

Share this post


Link to post
Share on other sites
Good morning. I am using both NS bits and PLC bits. I am using READCMEM and WRITECMEM to "convert" them back and forth. This seems to work pretty well when I need to do some macro work.

Share this post


Link to post
Share on other sites
Macros are good way to create functions that don't already exist as an NS object. The downside is that they are not scanned like a PLC but only run once when activated. The NS has system bits for communicating with the PLC especially for screen changing.

Share this post


Link to post
Share on other sites
Ahh, I see what you're talking about. Ok, my next question, I believe, has to do with syntax in my macro programming. What I am trying to do is momentarily turn on two bits at the same time with one button. The PLC bits are 1000.00 and 1010.00 Normally, I would just use an on/off button to write the address. However, with 2 bit change requirements, I thought that I would just add a Touch OFF macro. My macro is as follows: $W01010=1; WRITECMEM([serialA:01010.00],$W01010,1); I am getting a programming error when I try to do this. Is this a syntax or method error? Also, is this the method I use, or is there a better command? Thanks!

Share this post


Link to post
Share on other sites
Sorry for above...forgot to login

Share this post


Link to post
Share on other sites
You have defined your varaiable as a $W. The value that you want to set in the PLC is a bit. Therefore you will need to do a $B variable. Something like below: $B01010=1; WRITECMEM([serialA:01010.00],$B01010,1);

Share this post


Link to post
Share on other sites
"An error occured during macro execution. Check the macro program of the appropriate object ID and the connection with the host. [incorrect Program]....." I am connected serially, and am having no problem communicating back and forth between the PLC and NS in other operations. I'll double-check, but I'm not quite sure.

Share this post


Link to post
Share on other sites
Ok, I've got it. Darn symantecs.... You'll notice in my previous post that I was using; ....[serialA:01010.00],.... I needed to put it as: ...[serialA:01010]... Adding in the .00 was giving me the error. Tig

Share this post


Link to post
Share on other sites
I had found the problem and was in the process of editing my original answer, switched to a different computer and totally forgot to send the edit. Here it is.... You have defined your varaiable as a $W. The value that you want to set in the PLC is a bit. Therefore you will need to do a $B variable. Something like below: $B01010=1; WRITECMEM([serialA:01010.00],$B01010,1);

Share this post


Link to post
Share on other sites
Jeez...sometimes I'm such a duh head. OF COURSE IT'S A BIT! Ok. Thank you, Jay for reminding me it's a monday :)

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