Formal Parameter Of Sequence Requirement


raining010

Recommended Posts

Hi, admin

 

I have a requirement at present, which I often use in citect and feel very useful, I didn't find that in DAQFactory, so ask it here.

 

I define a popup window, which includes two buttons - start button & stop button

I have 10 motors, eg.,

use modbus RTU protocol, their addresses are all 1, just different registers. So there are 10 registers for starting and 10 registers for stopping, I define 20 channels for them.

Don't want to define 10 popup windows to start/stop these 10 motors.

 

My function is like this, while I click one of motors(eg, motor3), it pops up the window, sends two names of channels(start_motor3, and stop_motor3) to these two buttons. I click the two buttons in popup window, could control motor3.

Same with this, if I click motor5, then in same popup window, I could control motor5.

 

I did some practice, it can send name of variable to popup window's buttons, but they are strings, can't output to the channel.

 

Could you please advise what kind of variable and function I should use? The more detailed the better. Thanks

Link to comment
Share on other sites

Yes, you definitely do not want to have to create ten identical popups!  You'll want to use a technique that you can also use if with regular pages as well.  You basically create a variable to hold the number of the motor (or the name of the channel) to be set, display the popup, then have the buttons use the execute() function on a string you construct using that variable to set the correct channel.

 

I've attached an example of this functioning.  I use separate sequence functions instead of putting all my script in the actions.  Click on one of the indicators to display the popup.  You could of course use a separate button.

 

The example requires 5.87a

motorButtons.ctl

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.