Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Use a pushbutton to set a numeric value

How do I get a pushbutton object to write a numeric value to a data address when the button is pressed?
0 Kudos
Message 1 of 5
(3,296 Views)


Make the following connection to the datamember:

Modbus1.40001 = if(Pb1, Exp1, Modbus1.40001)

Here, Modbus1.40001 is the datamember you want to write to, for instance; Pb1 is the pushbutton, and Exp1 is the source of the numeric value you want to write (this could be anythin, like another Pot1, another Datamember, a constant, anything evaluating to a numeric value).

We put the same datamember we are writing to (Modbus1.40001 in our example) back in the "Else" case because we don't want to change the value when the pushbutton is not pressed.

Hope this helps. Regards,

Khalid


0 Kudos
Message 2 of 5
(3,296 Views)
Khalid -

Thanks for the response, however I'm not sure where you're suggesting this connection should be made. I can get one button to work if I make the connection in the server, but this seems to violoate the general rule of making all connections remotely from the client. Also, in doing it this way, it doesn't seem like multiple buttons can write the same data object. I suppose nested IF's could be used, but that could get very messy with multiple PB's.

On a different subject, where can I download the CTI Siemens TI 505 ethernet driver? I've found articles in the knowledge base that say it exists and ships with Lookout, but I don't see it in the drivers objects and can't find in on the website to download.

Thanks for your help.
-Rob
0 Kudos
Message 3 of 5
(3,296 Views)
Hi Rob,

Regarding the connections to the modbus datamember: if you are on your client machine, you have probably created a symbolic link to the server. That symbolic link should contain the modbus object as well, so if you make connections to that object on the client, all connections to the server will be taken care of through the symbolic link. If you are unfamiliar with symbolic links, you can find information here:

http://zone.ni.com/devzone/conceptd.nsf/webmain/521E3D01640C6984862568E9006F89B9?opendocument

http://zone.ni.com/devzone/conceptd.nsf/webmain/E8E59450D5AB172786256A3F0079A6A2?opendocument

Next question, the Siemens TI 505 driver should be listed in the drivers section of your Lookout drivers. The exact name is SiemensTI50
5. This object was available at least in Lookout 4.5.1 and later, but probably 4.0.1 as well. It uses the HI ethernet protocol via the CP1413 ethernet commications card.

Hope this helps.

Patrick R.
0 Kudos
Message 4 of 5
(3,296 Views)
Patrick -

I am using a symbolic link, and have read through the two articles you listed. I am, however, still unclear as to exactly how or where to make the connection you suggest. On the client, if I put the connection in the remote URL window of the object properties, the pushbutton gets X'd out. If I go into the object explorer and try to edit connections to the remote data object, it doesn't let you edit connections to remote objects. If I try to edit connections of the pushbutton object, it only lets me write information to the pushbutton, not write information from it to somewhere else. Thus, I just don't see how or where to make the connection you describe remotely, and be able to write to the remote data object.

As for the S
iemens driver, I have a CTI-2572 Ethernet card, not the CP1413 H1 protocol card. I did figure out that the TIWAY driver object is the one I need to communicate with this card.

Thanks for the help.
-Rob
0 Kudos
Message 5 of 5
(3,296 Views)