When scripting within HSDIO there is a limitation when it comes to nested repeats. For example, you cannot run the following script:
Script myScript
Repeat 100
Repeat 300
Generate wfmA
end Repeat
end Repeat
end Script
As you can see, there is a nested repeat, and if you try and run this script you will get an error. This example will show you how to get around this limitation using For Loops and Arrays.
Dynamic Generation with Marker and Nested Repeats.vi will show you how to code this and note how we output a Marker to PFI 0. This will be used by Dynamic Acquisition for Nested Repeat.vi to acquire the data you generate so you can verify your results. Also, I have attached the HWS file Wfm1 which I used to generate data.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
I just tried this example (Dynamic Generation with Marker and Nested Repeats.vi) and have verified the waveform is generated correctly, but cannot verify the marker on PFI1. I modified the example to use PFI1 instead of PFI0. I also modified the script to set the marker0 position from 12 to 0. Position 12 does not exist as the Wfm1.hws file only contains 10 data points. Using 12 as the value generates error -1074115614 at the niHSDIO Write Script.vi.
The HSDIO module being used is a PXI-6544. My software is LV2015 and HSDIO 2015. I am using a logic analyzer/oscilloscope to view verify the signals from the HSDIO module (at least HSDIO channel 0 and PFI1). Attached is a screen shot of the scope where the acquisition was triggered for channel 0. The logic analyzer channel 4 is connected to PF1. Is this marker functionality supported by this card? Are there any modifications necessary for the example code?
After changing my selected PFI line to 2 or 3, instead of 1, I was able to sucessfully generate and capture a triggered marker example. I'm not sure why the PFI1 line did not work. There may be a hardware issue or there is some special software setup necessary for PFI1, that I am not performing.