From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform scripting length limitation on PXIe 5442 (also for PXI 5421)

Hello All,
 
I have been using waveform scripting with the PXIe 5442 and I have run into a problem/ limitation. What I really need is a way to nest two deterministic loops. Since this is not currently possible, I have been using "poor man's looping" in the script by recurring the code N times to accomplish the outer loop. This script is dynamically generated based on user defined experimental control script, so in some cases it would need to repeat a single waveform as described below. However,  it is just as likely that two separately triggered waveforms would need to be repeated.
 
The below script might describe the scenario best (the line number are for reference here but would not appear in the actual script
 
1: script script1
2: Generate zerowfm
3: Clear scriptTrigger0
4: Wait until scriptTrigger0
5: Generate zerowfm
6: Repeat 5
7:    Generate wfm1
8: end repeat
9: Clear scriptTrigger0
10: Wait until scriptTrigger0
11: Generate zerowfm
12: Repeat 2
13:   Generate wfm2 marker0 (4)
14: end repeat
15: end script
 
In this case the zerowfm just forces the AWG to settle to 0 volts in between triggers, wfm1 and wfm2 run when each new external trigger is received.
 
Now if I want to repeat wfm1 I can cut and paste lines 3 through 8 into location 9. Shown below - changes in bold
 
1: script script1
2: Generate zerowfm
3: Clear scriptTrigger0
4: Wait until scriptTrigger0
5: Generate zerowfm
6: Repeat 5
7:    Generate wfm1
8: end repeat
3: Clear scriptTrigger0
4: Wait until scriptTrigger0
5: Generate zerowfm
6: Repeat 5
7:    Generate wfm1
8: end repeat
9: Clear scriptTrigger0
10: Wait until scriptTrigger0
11: Generate zerowfm
12: Repeat 2
13:   Generate wfm2 marker0 (4)
14: end repeat
15: end script
 
 
This scenario works fine, until I want to loop lines 3 through 8 more than 126 times. I do not see any active error popups even in Debug mode (CVI 8.5). Failure is noted when the wfm 2 fails to trigger the digitizer with the marker event attaced to wfm2. Error indicates that data acquisition  has not started on the digitizer (PXI 5122.)
 
I am either overrunning a hardware script buffer on the AWG or I have a slight clock mismatch between the AWG and the external trigger source that always works 126 recurrences  (and never works 127 recurrences) of events 3 through 8 - as above. I am having a hard time believing the clock mismatch scenario as I increase the delay between the triggers from 1 ms to 10 ms to 50 ms the results are the same.
 
I have looked a bit through the documentation that I could find and I don't see where the script buffer size is defined (default size) or if there is a function to increase the size.
 
I would also like to know if I can expect any differences for any solution when applied to a PXI 5421 in a similar configuration.
 
Any thoughts would be appreciated.
 
Greg
 
0 Kudos
Message 1 of 10
(8,733 Views)
Hi Greg,

I don't see any problems with your script.  Are you copying lines 3-8 126 times or making other modifications?  The script length limitation is just going to be the size of your onboard memory.  So, making sure that you are within that amount for your waveform sizes + the size of the script would be the first thing I would check.  If you could supply these numbers, that would be the best verification.  Also, what memory option are you using?  If the problem persists and you are within the memory size I will want to try out the scenario on our end to see if we can reproduce the problem.  Could you post a small version of your code that reproduces the problem?

Regards,
Paul C.
0 Kudos
Message 2 of 10
(8,711 Views)
Hi again Greg,

I just found that similar behavior was filed to R&D (3YQ8H3XY) and is being looked into.  It looks like there is a limit on the number of generate commands that can be used in a scipt.  The report suggests a limit of 50 on the 5421.  I assume this might be the same type of problem you are running into on the 5442.  I'm going to look into this more.  If you could answer my previous questions, I will let you know the results as soon as possible.

Regards,
Paul C


Message Edited by Paul C. on 04-28-2008 06:31 PM
0 Kudos
Message 3 of 10
(8,697 Views)

Hello Paul,

The PXIe5442 has the 32 MB option.  I am using a 128KB (131072 actual) block for PC RAM script storage. I bumped this when the previous smaller buffer was exceeded  and generated an error. While I did not count the bytes here, I assumed a similar overflow would generate a similar error. (CVI v8.5)

I also plan to occasionally stream the (5442) with a 8262/8263 RAID option with waveform scripting so any known roadblocks there would be appreciated.

Finally, I will need to know about any script limitations with PXI5421 - 32MB option. I actually have several more of these configurations to worry about.

All of the systems use some form of PCI-PXI / PCIe-PXI / PCIe-PXIe remote controller (not that it matters for this particular issue.)

Thanks,

Greg

0 Kudos
Message 4 of 10
(8,677 Views)

Hi again Paul,

 

I should never read a post leave and then reply without re-reading. The other info you wanted.

Yes, the script with 126 (total) loops of 3 through 8 will run. The script with 127 loops will not complete before time out.

Waveform sizes zerowfm - 8 samples {0, 0, 0, 0, 0, 0, 0, 0}. wfm1 - 10,000 samples (swept frequency ), wfm2 - 120,000 samples (sine wave) Script buffer size 131072 bytes

Total memory use 391,088 bytes.

Memory option PXIe 5442 - 32 MB

Code snippet - I will need to extract from longer code give me a day or two. Coding question, I use a Spincore Pulseblaster PCI to time my experiment, how should we deal with the external triggering of the AWG?

I guess I can set it up and you can provide an appropriately spaced pulse train to trigger the device.

Greg

0 Kudos
Message 5 of 10
(8,663 Views)
Hey Greg,

Thanks for the information.  I will setup a system to test out your code.  If you give me specifics on the timing of the trigger, I can set something up for it.  I have some counters I can use  to setup a pulse train for the trigger.  Just let me know the rate you're using. 

Regards,
Paul C.
0 Kudos
Message 6 of 10
(8,649 Views)

The pulse train that we use is (non standard - of course) user defined and asymmetric. Essentially, the minimum time step is the width of the output waveform plus 10 ms. More specifically, the up pulse of the TTL is defined by the width of the waveform and the user program requires at least 10 ms of down pulse prior to triggering the next waveform. Often this time is significantly more than 10 ms.

I am trying to get a baby program hacked out of our larger code that will use just the NI awg, NI digitizer, and any external trigger train. The requirement on the awg and scope is they must be Tclock enabled -  although with the code you could work around that.

 

Greg

0 Kudos
Message 7 of 10
(8,640 Views)
Hey Greg,

While you're setting this up.  I'm working on setting up a simple example to see if I can determine if it is the same issue as described above so I can properly file it to R&D so they can look into it.  I will let you know the results.

Regards,
Paul C.
0 Kudos
Message 8 of 10
(8,625 Views)
Hello Paul,
 
I finished up the standalone. It essentially proved to me that I sent you on a wild goose chase. There was a related error in the code to the NI6733 that was used to trigger the AWG. Essentially, the code failed when it had to switch over from onboard storage to cyclical buffering (in a new thread.) Long story short , the initialization of that thread got "broke". I hate it when old code screws up new code - I guess Microsoft has it a lot worse.
 
Sorry for the chase.
 
If you still want the stand alone code, I can post it. It requires an AWG and digitizer with Tclock, as written. It also requires any digital pulse train to trigger the AWG - a simple benchtop square generator works fine.
 
If you don't want the code consider the matter resolved (or nonexistent as the case may be).
 
Greg


Message Edited by blakney on 05-08-2008 08:52 AM
0 Kudos
Message 9 of 10
(8,572 Views)
Hey Greg,

I'm glad to here you got it working.  I think the code would be great to have for other customers reading this thread trying to do a similiar application.  Let me know if you have any other problems.

Regards,
Paul C.
0 Kudos
Message 10 of 10
(8,555 Views)