Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Signal synchronization with PCI-6602

Solved!
Go to solution

Hi,

 

I need to generate three signals that need to be synchronized.

In order to do this, I'm using a PCI-6602.

The first signal is used to trigger a device, the second signal is used to simulate noise.

The third signal should gate the noise so that it starts before the trigger signal and stops a little after the trigger signal.

The signals are then combined with an external logical circuit.

 (In order to see what I mean, refer to the first PDF).

 

I'm using a fourth timer in order to synchronize all the other timers, however the three signals start to run before the timer task is started. I've evaluated this using single stepping and an oscilloscope.

The trigger and the gate (first and last signal) are below 100Hz, the noise signal is about 200kHz.

At least the trigger and the gate need to be started synchronous, otherwise the waveform is not what we desire. The noise signal need not be synchronized.

 

I'm pretty sure I'm just lacking a little detail here, maybe you can show me what I missed.

Please check my LabView screenshot in order to see what I did here.

If you need further information on the VI, I can strip it down a little and send it, too.

 

Download All
0 Kudos
Message 1 of 6
(5,263 Views)

Hi mschnick,

 

there are very nice synchronization features available in DAQmx, but you are not using them. Take a look at the LabVIEW Example Finder and go to "Signalerfassung- und ausgabe mittels Hardware" (Hardware input and output) > DAQmx > Synchronization > Multi-Function. If you look at these examples, e.g. Multi-Function-Synch AI-AO.vi you can see how synchronization is done (and this is hardware synchronization, not software like you did).

 

You could also take a look at Timing and Synchronization Features of NI-DAQm.

 

Regards

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
0 Kudos
Message 2 of 6
(5,226 Views)

Hi,

 

first of all, thanks for your time and your answer.

I have already gone through the examples before I set up my test. Unfortunately, I cannot run these examples on our hardware as the PCI-6602 does not support any analog inputs or output, it only features digital inputs and outputs.

 

 

So, I reviewed the text available at the link and tried to set up a new project that should create the signals I require. The project / VI is included as attachment.

I did the following:

Using the outputs Dev2/ctr0, Dev2/ctr2 and Dev2/ctr4, I am creating 3 signals with different frequencies and duty cycles. These signals are connected and observed on the oscilloscope.

 

Using Dev2/ctr6, I wanted to create a clocking signal for the three outputs.

The output of Dev2/ctr6 should be wired to Dev2/PFI12, if I understand the SCB68 manual correctly.

 

Using the first while loop, I wanted to delay the clocking signal until the start button is pressed.

However, the 3 signals are already emitted as soon as their StartTask.vi has been passed; they are not waiting for the clocking signal to start.

 

It seems that I'm missing a point here. Can you please explain which setting or different VI needs to be chosen in order for the Slaves to wait for the master clocking signal?

 

Please find the new VI attached to this posting. I'm also attaching a screenshot of the VI to this posting.

 

Many thanks.

 

Best regards

MSchnick

Download All
0 Kudos
Message 3 of 6
(5,216 Views)
Solution
Accepted by topic author mschnick
Try using start triggers for the 3 counter outputs (See attached VI)
Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
0 Kudos
Message 4 of 6
(5,212 Views)

Hi again,

 

thanks for your suggestion.

Unfortunately, the modified VI does not work, it will throw an error message when trying to execute the DAQmx Start Task.vi after running the

DAQmx Start Trigger (Digital Edge).vi:

 

The thrown error is -200787, here's the printout:

 

Possible reason(s):
Specified Start Trigger Type is not supported for counter output tasks when the Sample Mode is Hardware Timed Single Point on this type of device.
Set the Start Trigger Type to None to use this Sample Mode.

Property: Start.TrigType
Requested Value: Digital Edge
Supported Values: None

 

 

It seems that swapping the Start Digital Edge task and the DAQmx Timing task does not solve this problem or even yield an error message indicating which values are allowed here.

 

Are you able to help me with this, too?

 

Many thanks

Michael Schnick
0 Kudos
Message 5 of 6
(5,195 Views)

Hi,

 

I need to repeat my request.

The VI I received seems to be broken, it creates error -200787.

 

I was able to resolve this error by removing the StartTrigger blocks.

 

However, now the tasks are only triggered once instead of multiple times. It is required to run the for a specific number of times, e.g. 1000 cycles.

I've tried to achieve this by sending the triggering signala couple of times by introducing a DAQmx Timing (Implicit) with a number of Finite samples.

It seems that the signals which I really use do not get armed again.

 

Please have a look at the updated VI and give me another hint.

 

0 Kudos
Message 6 of 6
(5,127 Views)