06-30-2009 05:02 PM
I am trying to setup a pressure controller using the .Net 2.0 API. I setup the device as follows:
NIDevice = New Device(0,16)
NIDevice.IOTimeout = TimeoutValue.T3s
NIDevice.Clear()
Then I set the Pressure Controller to a pressure:
NIDevice.Write("R1S3U16N1P=50C1F21")
I query the device for the pressure in a timer every 500ms as follows:
MyString = NIDevice.ReadString()
The second time it tries to read from the device I get the following error message:
"Time limit exceeded to complete operation."
Any ideas?
07-01-2009 12:03 AM
Does the device really send the pressure data without being queried ? I guess the first time, when it works, it just responds to the setting command. But for the second read , you have to send a new command to get a response. Either a special query command or just resend the same setup command.
However this is only guessing, because you did't tell us anything about the manufacturer and type of the device, you are using.
07-01-2009 10:47 AM
The Device in question is a Druck DPI 520. When I use the Traditional Drivers, yes, once the device is initialized, all I have to do is:
Call NIReceive(0, 16, Buffer$, STOPend)
and the device responds back with the pressure.
When I use the .NET calls, I get the TimeOut message on the second attempt at reading...
I am in the process of talking with Druck directly to see if there is a query command I can send it. I don't see one in their Manual at all...
07-01-2009 11:13 AM
07-01-2009 04:03 PM
Hi,
I agree with markus, usually you need request the device to return data in order to be able to read anything. It appears that your device may return the pressure every time it is communicated with, which may explain why it returns the pressure once, when you set the pressure and again when you query with nothing in the Send String box. Your device may interpret that as a remote frame requesting information and thus the device returns the pressure. Does your device return the pressure every time you query it with anything, like the default “*ind?” ?
Regards,
Matt07-01-2009 07:12 PM
Ran you NI Spy utility to see what the "NI-488.2 Communicator" software was sending for the "Query" command without any data in the "Send String" box and noticed that it was only sending a NULL.
Tried doing the same thing in the .NET call as follows:
NIDevice.Write("")
NIDevice.ReadString()
and it works correctly. Thanks for all the suggestions and help...