|
Reading and writing Variables from labview Jan from Switzerland [6 posts] |
13 year
|
Hi,
i'm using the labview API example source file, and i have some trouble.
Why is so slow write and read variables from labview, with "rr_getVariable" and "rr_setVariable" functions?
It take about 4 seconds for this task.
Also other functions don't work very good.
Contrariwise "rr_getImage" works very well!
thanks
Jan
|
|
|
Anonymous |
13 year
|
Jan,
We reviewed the LabView CVI code and it appears to be ok. Can you include a short code snippet of how you are using the rr_getVariable so that we may be try again to replicate the issue that you are having.
Typically with those kinds of delays something is either not connecting or getting a response and then just timing out.
Also, we assume you are working with the CVI code and not the vi examples?
Thanks,
STeven.
|
|
|
Jan from Switzerland [6 posts] |
13 year
|
Hi Steven,
Yes, I'm using the CVI codes.
I added the "Joystick" button for get the X joystick variable from RR, using the attached *.robo file.
The SW crash when I try to enable the timer (continue display the image) and make a request of one variable, but one function without the other work well.
I think it's just an access priority question.
RR settings: API server Port 6060, Timeout=10, Threads=5
Thanks
Jan JS_X variable.zip CVI File.zip
|
|
|
Anonymous |
13 year
|
Jan,
Thanks for the code, that helps to quickly narrow down the issue.
1. Try using a zero as a timeout in RR. That basically disables the timeout and will not close the connection ... this was probably not happening in your case but just for debugging purposes for now it is recommended.
2. There was a problem in the CVI api code that would cause a delay on a variable read. The rr_readMessage was waiting for more than the response given and thus caused a delay. The zip below includes your code with this corrected routine. It appears to work well for us now.
3. We did not get anything to crash so be sure to download the most recent copy of RR which may have solved that issue.
If you do still get a problem could you include your .exe in the zip so we can test exactly your version?
thanks,
STeven. CVI.zip
|
|
|
Jan from Switzerland [6 posts] |
13 year
|
Hi STeven,
Thanks for the help!
Now it works well.
Jan
|
|