Control Via Daqconnect/DacFactory


andybdjuk

Recommended Posts

Hi, I wish to be able to push a on/off button in Daqconnect, pass this on to DaqFactory to be passed on to a controller.

Can you tell me how I set up a channel in DacFactory to receive data from Daqconnect.

Thanks

Link to comment
Share on other sites

You don't. You have to create an event sequence to handle any control requests. This forces you to consider implementing checks for valid control values. It is all described in the DAQFactory help and I believe in the DAQFactory portion of the DAQConnect help.

Link to comment
Share on other sites

Alas I have read all the help but as im a bit of an idiot i dont understand what i need to do. Maybe you could help me out a little more.

Thanks

Andy

Link to comment
Share on other sites

1) In DAQFactory create a sequence called exactly "OnDCSet" without the quotes. This sequence gets called whenever a command comes in from DAQConnect. You'll get two private variables, "key" and "val". Use key to determine which channel to set, and val to determine what to set it to. Add something like this:

if (key == "myoutput")
   myoutput = strtodouble(val)
endif

2) to actually set the command, go to the OnClick event for one of the controls in DAQConnect and put something like:

Set("myoutput",5.243)

If you have more than one connector, you'll need to add the connector name:

Set("MyConnector.MyOutput", 5.243)

Note that string comparison in DAQFactory is case sensitive, but key will always be in lower case, even if you put uppercase in the set() call. Also, the connector gets stripped out, so Set("x.y",3) will only pass the "y" through to DAQFactory.

Link to comment
Share on other sites

Archived

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