Download User Guide

Transcript
4 Programming Mathematica Link for LabVIEW
In[5]:=
If[LinkReadyQ[link], LinkRead[link], Print["The link is
empty"]]
Out[5]=
1
In[6]:=
If[LinkReadyQ[link], LinkRead[link], Print["The link is
empty"]]
Out[6]=
2
In[7]:=
If[LinkReadyQ[link], LinkRead[link], Print["The link is
presently empty."]]
Out[7]=
3
In[8]:=
If[LinkReadyQ[link], LinkRead[link], Print["The link is
presently empty."]]
The link is presently empty.
The output is dependent on the data you sent and may be different from
those illustrated here.
Making sure that the link is ready before reading it is a wise
precaution: LinkReadyQ[link] is included in the If statement for this
purpose. Keep in mind that if nothing is ready to be read, the LinkRead
command will hang until something arrives. It is important to
understand this because LinkRead cannot be aborted. A hanging,
unabortable LinkRead command is undesirable because you increase the
likelihood of collecting data whose origin you do not know.
100