LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous/synchronized acquisition and generation with scripts on PXI-6551

Hello,

 

I'm trying to perform simultaneous acquisition and generation using scripts.  The script is as follows

 

myscript = "script testscript" 

                "clear scriptTrigger0" 

                "generate wfm1"

                "generate wfm2"

                "repeat 5"

                   "clear scriptTrigger0" 

                    "wait until scriptTrigger0" 

                    "generate wfm3 marker0(0)" 

                    "generate wfm4 marker0(0)"

                    "generate wfm5 marker0(0)"                   

                    "generate wfm6"

                "end repeat"

           "end script"

 

 The marker0(0) is exported to a PFI2 terminal to which PFI3 is also shorted.  A multi-record acquisition task receives a trigger for each record from PFI3.  However, I'm currently prevented from allocating the same resource "PXI1Slot2" by the software.  

 

How can I accomplish this?  It appears that once the resource is allocated for script generation, simultaneous acquisition is prohibited.  Please confirm.

 

Anand

0 Kudos
Message 1 of 5
(2,621 Views)

Hi All,

 

Here is the error message I get

 

Error Found!
Code: -1074118636
Resource requested by this session has already been reserved by a different session.

 

Thanks for any assistance.

 

Anand

0 Kudos
Message 2 of 5
(2,620 Views)

You are able to use a script to generate a waveform and then acquire at the same time.  I am currently working on an application that performs this task.  However, you need to make sure that the channels are not being used in both tasks. Do you have anything else running in the background?  How do you have everything set up (channel usage, programming flow)? 

 

Also, I am noticing that you are exporting the marker to PFI2 and then reading it in on PFI3.  If you do not want to externally route this trigger you can just specify the same PFI line to send and receive the trigger.

Regards,
Jordan F
National Instruments
0 Kudos
Message 3 of 5
(2,565 Views)

Hi Jordan,

 

Thanks for the response.  To clarify

 

1.  The code I'm using was previously setup for simultaneous generation and acquisition with hardware triggering.  Then I just modified it to run scripts.  So the channels are unique to the two tasks.

 

2.  There is nothing else running in the background.  

 

3.  The programming flow is as described in item 1.

 

Once you are also able to do this, it will be instructive for me to see the details of your code.  If you would like to see mine (in Visual basic) I would be glad to email it to your National Instruments ID.  Our work request number for this is #7244936.

 

Thanks.

 

Anand

0 Kudos
Message 4 of 5
(2,562 Views)

I would be interested to see your code so I know more about your application.  The code I am working on is in LabVIEW and is a basic loop back program that uses a script for generation.  If you do not mind posting on the forum that would be fine, otherwise, you can send me an email.  Currently, I have a service request open for you at that SR number.

 

One other thing, could you provide a screenshot of the error?  Is the error regarding "Trigger Resource reserved"?  I am interested in your current triggering scheme and what you are setting up.

Regards,
Jordan F
National Instruments
0 Kudos
Message 5 of 5
(2,538 Views)