Remote Control Via Daqconnect/DaqFactory


dvalerio

Recommended Posts

Hi!

I want to be able to push a on/off button in Daqconnect and pass the value on to DaqFactory.

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

I've already put an imagen that works like a button in DAQConnect, in the Click section of that image, I entered this comand:

 

set("PruebaTCP01.Testing()",1);

 

My Data Source is called "PruebaTCP01" and my Tag is called "Testing".

In DAQFactory, I have a Channel Called "Testing" according to the Tag in DAQConnect, with the next configuration:

Quote

 

Device Type: Test

Device Number: 1

I/O Type: Dig Out

DAQConnect?: (Yes)

 

 

I tried to establish the sequence (OnDCSet), as you say in your AzeoTech DAQFactory Users Guide, Section 12.2 (in Control from DAQConnect), I wrote this:
 

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

But in the command/alert windows appears: 

Quote

C1000 Channel or function not found: OnDCSet Line 1 - Uncaught error in sequence OnDCSet

So, I added  

     private string key; 

 trying to fix the problem, but I got this new error:

 

Quote

C1086 One of the parameters was empty: OnDCSet Line 2 - Uncaught error in sequence OnDCSet

 

I don't know what I am doing wrong, so I hope you can help me establish remote control from DAQConnect to DAQFactory.

 

Thanks.

Link to comment
Share on other sites

Thanks for your response.

I changed the set() call as you said, and put: 

set("PruebaTCP01.Testing",1);

In DAQFactory I still have problems tying to Star Sequence. My Sequence is called "OnDCSet", and it has this parameters:

Quote

 

Thread Priority: 5-Acquisition

Auto-Start: (Yes)

 

And the conde inside the Sequence is:

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

When I Clik in "Begin Sequence", this error show up:

Quote

C1000 Channel or function not found: OnDCSet Line 2 - Uncaught error in sequence OnDCSet.

I hope you can help me fixing my problems.

Thanks!

Link to comment
Share on other sites

By the way, I tried to make the sequence respond making the initialization of the variables.

When I initialized the variables "key" and "val", the sequence compile and response every time I click "Begin sequence", but I don't know why I have to Initialize the variables:

private string key;
private string val;

key="Testing"
val="1"

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

In that way, the sequence response correctly, but I think something is wrong setting the remote control with DAQConnect.

Help!

Thanks!

Link to comment
Share on other sites

You should not be running the sequence from within DAQFactory.  DAQFactory will run the sequence automatically when a request from DAQConnect comes in.  Your first sequence is the correct one:

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

but you should not have the sequence marked Auto-Start.

When a control command comes in from DAQConnect it will run the sequence, passing the key and val to the sequence.  You have to have an active connection with DAQConnect.

Link to comment
Share on other sites

Thanks for the answer.

I removed the mark of "Auto-Start" and set the code as you told me:

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

The sequence compiles right and errors does not pop up anymore.

I just can't establish connection between DAQConnect and DAQFactory.

I put a LED to turn on each time the sequence assigned the value of Testing to 1.

When I click in "Begin Sequence" in DAQConnect, the led ligths up, but when I click a text-button in DAQConnect, it doesn't do anything.

My text button has this configuration:
 

Quote

 

Text Button

Main:

Name: Send_Command

Style: Verdana 12

Hover Style: Verdana 12, B

Pressed Style: Verdana 12, B, I

Control_ID: AutoGenID_4

Click:

set("PruebaTCP01.Testing",1);

 

I think I'm doing something wrong sending the value from DAQConnect to DAQFactory.

I verified the connection between this two, and it is Ok, i am monitoring an input value and have no problem.

Please, help me.

Thanks.

Link to comment
Share on other sites

Sorry bothering you again, but errors are poping up again. 

I don't know why they weren't appering before. In the sequence, i have this:

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

But this error appears:

Quote

Channel or function not found: OnDCSet Line 1 - Uncaught error in sequence OnDCSet

Please, I followed your instructions carefully, but I still can't make it work.

Thanks.

Link to comment
Share on other sites

Archived

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