Discussion:
Scripted I/O with the DIO 6552
(too old to reply)
Jakeus
2007-03-05 20:10:10 UTC
Permalink
Here is what I'm trying to essentially create:
   ViConstString script1 =       "script myScript1 "      "  repeat 200"      "     generate myWfm1 "
      "     if myWfm1 passed"
      "          generate myWfm2 "      "  end repeat "      "end script";
 
im trying to find some way of creating decisions based upon whether or not the waveform passed the digital burst test.
For example, my waveforms consists of several pins some input and some output with values such as 0,1,Z,H,L.
 
Any suggestions would help me alot, thanks.
Jakeus
2007-03-06 17:10:12 UTC
Permalink
A couple more questions:
 
#1:
I'm tryin to find this export error event function in Labwindows CVI, but I seem unable to find it. 
I'm looking in:
NI HS-DIO Instrument -> Utility Functions -> Set/Get Attribute -> Set Attribute -> SetAttributeViInt32
There are many Attribute ID's you can choose from, some "events" being "ready for start", "ready for advance", "end of record",  "data active event", and "marker event".  If I'm looking in the wrong place completely, please let me know.
 
 
#2:
"if scriptTrigger0", this is saying, "If the value on PFI0 goes high, then.." but only when I use this function to setup the script trigger:
niHSDIO_ConfigureDigitalLevelScriptTrigger (&vi, NIHSDIO_VAL_SCRIPT_TRIGGER0, NIHSDIO_VAL_PFI0_STR, NIHSDIO_VAL_HIGH);
 
I could also make it trigger on a low level by changing the function to:
niHSDIO_ConfigureDigitalLevelScriptTrigger (&vi, NIHSDIO_VAL_SCRIPT_TRIGGER0, NIHSDIO_VAL_PFI0_STR, NIHSDIO_VAL_LOW);
 
 
#3:
And my waveforms, is there some way to designate 'H','L',0,1,'Z'?
For example:
myWfm1=[0,0,0,0,1,1,1,1];
myWfm2=[L,L,L,L,H,H,H,H];
myWfm3=[Z,Z,Z,Z,Z,Z,Z,Z];
 
I guess what I'm asking is, does the waveform take characters, integers, or strings...?Message Edited by Jakeus on 03-06-2007 11:09 AM
Jakeus
2007-03-06 21:10:10 UTC
Permalink
Thanks for all the help, it is greatly appreciated!
I think with the information you've shown me I should be able to get it working, or close to.
 
One method I have been exploring was using the DWE to create my patterns.
So far I was just importing ASCII comma separated text, example:
 
data,data2
0,1
1,0
H,1
L,1
L,L
1,1
0,X
X,Z
 
In attempts to make it more automatic, I am trying to go directly to a HWS file, but from looking at it, it seems like that might be impossible.
Do you know of any way to convert an imported text file to HWS directly?  Thus bypassing the user having to import the file to DWE then save it to HWS.
 
Thanks again for all the help,
 
- Jacob.
Jakeus
2007-03-08 21:40:12 UTC
Permalink
Update:
 
I might of figured out my problem (although I'm about to leave my workstation for a bit), but I think what I need to do is use this function:
 
checkErr(niHSDIO_SetAttributeViInt32 (vi,"",HSDIO_ATTR_HWC_HARDWARE_COMPARE_MODE, NIHSDIO_VAL_HWC_STIMULUS_AND_EXPECTED_RESPONSE));
 
If anyone can confirm or deny what I'm thinking, please let me know.
 
 - Thanks,
 
Jacob.
Jakeus
2007-03-12 18:40:11 UTC
Permalink
Oh thats a perfect example!  That is basically what I'm trying to accomplish in a nutshell.  It works great, except for one part.  So I made some minor changes to it, and got some unexpected results.
Changes:
1.  Changed the acquision session to run off the internal clock
2.  Change the acquision session start trigger to PFI1, the same trigger as the data active event on the generation session.
 
The program works fine when I try running it values less than 27 MHz.  When I try to go above 27MHz, the program cannot correctly determine where the errors are.  Is this due to the changes I made or something elsewhere?
Continue reading on narkive:
Loading...