03-03-2011 08:36 AM
I send the RT data [RT desktop target] to the host over TCP at the moment. I was wondering if it was possible to connect the RT target with the host PC with a USB wire and send the data on USB?
The network is non-deterministic so I thought using a USB cable could make the data transfer deterministic.
Any thoughts about it?
03-04-2011 03:09 AM
What makes you think USB is deterministic?
Christian
03-04-2011 03:44 AM
hmmm...then why do people send data over TCP rather than USB?
03-04-2011 03:53 AM
I never saw a USB cable connection between two PCs. And both, TCP and USB are non-deterministic.
Anyhow, why do you want to have a deterministic communication between a deterministic system (RT Desktop) and a non-deterministic system (Host PC)?
Christian
03-04-2011 04:03 AM
I have asked about here how to synchronise an RT target with the host VI, e.g. how to achieve that the host VI reads the network shared variable exactly at that time when the data arrives.
So I thought that if there was no network connection but only a USB connection, it might make the data transfer deterministic or at least more predictable than in TCP case.
So do you know how to read the data packets from the network shared variable [TCP packets] exactly at the pace they arrive? I guess one could set up a listener to the network shared variable that generates an event that could be handled by an event structure. I just have no idea how to do such things in LabVIEW.
Krivan
03-04-2011 04:38 AM
Hi Krivan,
We would
use a RT system to perform deterministic processing, for instance, within a
control application. The reason we use a RT system as appose to windows, is
that windows cannot process deterministically, it has other processes running
within the OS that use up the processor's time, such as internet explorer, or
that update that arrives at the most inopportune moment So in most
RT applications, The RT system will do the processing and Windows will only receive
commands from the user and then send these on to the RT system, then receive an
output from the RT system and display it. So because we are communicating with
windows, the communication cannot be done deterministically.
I think the reason TCP is used is solely because it is a widely used standard communication protocol.
Regards
Rich
03-04-2011 04:39 AM
LabVIEW DSC supports ValueChange Events with Shared Variables, this is exactly what you are looking for.
Everytime the value of the variable changes (so when it will be written from the RT Target), an event will be fired on the host where you specify to read the variable.
Christian
03-04-2011 06:01 AM
Thanks, I will install the DSC module and try this ValueChange Events on shared variables.
Yes, the RT target does data acquisition, buffering and it tcps the data to the host. The host computer [VI] only further processes and stores the data [TDMS]. The proper timing on host was necessary because I wanted to kind of synchronise the data stream with RT target but I have to realise [especially by looking at other forum posts] that it is unlikely.
In my RT project a network shared variable has been automatically created in the host VI and in the non-deterministic loop. I understand that they are somehow linked but, apart from LabVIEW DSC and ValueChange Events, how do I know that data came in? I mean it is only a network shared variable without proper listeners, so what notifies the VI that data has arrived?
Krivan