02-16-2011 07:30 AM - edited 02-16-2011 07:34 AM
Hi,
I have a 'large' measurement system of 6 devices communicating via TCP protocol. The system is designed to use REST (representative state transfer) with JSON (JavaScript object notation).
Now, I need to add labview program to this environment. I have established a 'working' solution with the help of this forum. Thank you for that! Now I need to make it better (currently no timestamps, large delays, etc).
I currently have a deployed web service using http-get as input. My web service .vi is just passing the web input to shared variables, which are then polled in the real measurement program. Reason for this is that when I put the measurement program directly to web service, it does not work (something about dependencies and rights). Measurement program includes a third party proprietary drivers (Instron). Also I would not like direct access via network to our potentially dangerous mechanical testing device.
Now I want to change the message passing from web services .vi to the measurement .vi. Currently I have a 10 ms loop polling for changes in shared variable. Is there a better way of doing this? I was thinking of creating an event listener for changes of the shared variable.
Also, if you have some ideas (preferably working example code) how to do the interface between labview and TCP-JSON I would really appreciate it.
br,
juha
Solved! Go to Solution.
02-16-2011 08:52 AM
Currently in LabVIEW the only way to create an event listener or a NSV event is to use the DSC toolkit. For the most part the DSC is a very expensive toolkit that just wraps functionality that is built into the PSP and SV engine and which is available to anyone who can program in LabWindows/CVI.
http://zone.ni.com/reference/en-XX/help/370051P-01/cvi/libref/cvicnvcreatesubscriber/
If you would like to work together, I would love to create a small LV library that would create basic SV events either by using a LV vi callback or possibly passing back a LV user event which is how the DSC toolkit works. I have asked NI many times to explain how to do this and they are very tight lipped about it. I guess they do not want to give LV users less reason to buy the DSC.
02-16-2011 10:15 AM
hmm, I have to look into this DSC toolkit...
Otherwise, creating a small LV library doing this does not sound bad, if you already have some ideas how to do it. My angle to this is a bit general, though. The events created and listened should be able handle also outside labview. This should be only a minor addition as labview has some activeX support (windows programming only).
br,
Juha
02-16-2011 10:33 AM
Ok, I think that the DSC-toolkit provides the necessary tools. As I am working in a big university the toolkits are not a problem...
If you want to do some developement with a more simple/general/free event-handling I am all ears.
br,
Juha
02-16-2011 11:04 AM
NI's MeasurementStudio provides this event
public event System.EventHandler<DataUpdatedEventArgs<TValue>> DataUpdated
Member of NationalInstruments.NetworkVariable.NetworkVariableSubscriber<TValue>
Summary:
Occurs when new data is available to NetworkVariableSubscriber<T>.
Best regards
Christian
06-12-2013 09:15 AM
Hi All,
I am trying to create event handler in VB2008 to handle change in shared variable values. Unfortunately I don't have access to DSC module of NI.
From your mentioned answer could you please elaborate this Dataupdate event handler from Measurement studio.
Many thanks in advance.
Awaiting for your response.
SKhilar