LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering function

Hi everyone!

From my circuit in labview I want to trigger another instrument (external trigger TTL signal 5V), so when I start running my Vi, everything will be synchronized and start measuring at the same time.

Can you tell me how can I do it?

I just want to generate a single pulse to "activate" another insturment.

I attached my Vi.

Timmer

 

0 Kudos
Message 1 of 5
(3,001 Views)

Hi Timmer,

 

I would recommend you use the DAQmx API for triggering applications. The triggering functionality provided by the DAQ Assistant is very limited. Here is some more information to get you started on triggering in LabVIEW.

 

If you simply want to generate a single pulse, the easiest way to do that would be to create a new DAQ digital task, start the task, perform a write, and then clean up. However, this will not achieve synchronization. Think carefully about whether you actually need synchronization or not. It can make your life a lot easier if you can get by without it.

 

Also, as a sidenote, have you considered using arrays and subVI's to manage your data in the VI you have posted? It would make your code much easier to read. It seems you are performing a similar operation multiple times so loops, arrays, and modularity would be helpful here.

 

Best,

 

Duncan W.

Message 2 of 5
(2,968 Views)

I tried to do in this way but doesn't work...

Do you know why?

I used the instead of digital output I configured as a counter.

But still, the UVPs don't start -,-

0 Kudos
Message 3 of 5
(2,943 Views)

Hi Timmer,

 

There is any number of reasons that your code isn't working that could be related to your hardware configuration, device limitations, bad code, or something else. Please read the resources I have provided so that you have a better understanding of how to use DAQmx. The code you have posted includes a lot of bad practices.

 

To give you some ideas as to where to start, I would recommend focusing on enforcing dataflow in your program, using subVI's to modularize your code, and using common design patterns in LabVIEW.

 

You also have a lot of type mismatches (look for the red coercion dot) that could be causing undefined behavior in your code. You probably want to look into LabVIEW training if you do not have very much experience in LabVIEW. Realistically, LabVIEW does have a learning curve and it will take some time to become familiar enough with the environment to leverage its functionality effectively.

 

I apologize that I am not able to help you debug this code directly. With more details about your application and goals, I might be able to offer some more direction for refactoring your code, but this code is rather far from reaching a point at which it will function for any application and even further from following good design practice. Honestly, I would recommend looking into the resources I have posted into this thread and consider approaching this problem from scratch after you feel more comfortable with LabVIEW.

 

Best,

 

Duncan W.

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

Posting for ease of access (colon missing above): Common Design Patterns in LabVIEW


GCentral
Message 5 of 5
(2,922 Views)