06-19-2023 08:31 AM
Hi community,
I want to record 2 synchronous generators triphase currents (CTs) and voltages (PTs) so I can read power (S, P, Q & PF). The only card combination that actually works for me is NI-9225 for PTs and NI-9238 for CTs. I use these cards for generator #1. For generator #2, I have a second NI-9225 but I don't have another NI-9238 so I tried using NI-9205 and NI-9222 instead but I assume these cards synchonization is not managed the same way since the current I read lags of about 16.5 degrees (~0.76 ms @ 60 Hz) compared to what I expect.
I use default settings of DAQmx Timing.vi (default onboard clock) and I wonder if I can do something with it to make my setup work.
Thanks!
06-19-2023 08:37 AM
You may need to investigate the trigger on each module.
I assume you are using a cDaq Chassis. you will need to trigger the Acquisition of both modules to start acquiring data at the same time, so you can have an accurate measurement of the phase shift when calculating PF.
06-19-2023 08:55 AM
See Signal-based Synchronization of Analog Input C Series Modules with NI-DAQmx in LabVIEW
06-19-2023 09:57 AM
Interesting document. I'm currently using the simplest method : Multidevice task. DAQmx driver does not synchronize properly automatically like specified. Does that mean that I just can't use this method?
Would I have to do trigger and sample clock synchronization manually as explained in the document?
I'm a bit concerned about the performance. I have an application where I can have about 25 individual channels set and since I want flexibility, I would need to build and sync 25 different tasks rather than 1 task like I have actually.
Thanks.
06-19-2023 12:43 PM
I tried to trigger and sync clock manually as per the document but I end up with either the error below or the vi runs and I get the exact same lag I had using multidevice task. It's random each time I run my vi, I have no idea why. Please see my vi attached.
Error -89131 occurred at DAQmx Start Task.vi:7220004
Possible reason(s):
An attempt has been made to perform a route when the source and the destination are the same terminal.
In many cases, such as when configuring an external clock or a counter source, you must select a PFI, PXI Trigger, or RTSI line as the source terminal.
Property: SampClk.Src
Property: SampClk.ActiveEdge
Source Device: cDAQ9189-1FB2D01
Source Terminal: ai/SampleClock
Task Name: _unnamedTask<109>
06-19-2023 01:01 PM - edited 06-19-2023 01:04 PM
Is that' because you are using the same device for both actions ?
You must define one "master" device to be the primary source of clock and start trigger and setup the other device to follow the master.
Your code use the same device for both- that explains the error message you received.
Check the paragraph Sample Clock Synchronization on the article shared previously.
06-19-2023 01:30 PM - edited 06-19-2023 01:30 PM
@LVNinja wrote:
Your code use the same device for both- that explains the error message you received.
Could you elaborate about this statement? I think I misunderstand what is considered a device. I have several acquisition cards and only one cDAQ-9189. In multidevice task section, a device seems to be defined as module of acquisition. So in my case, I have several devices on the same chassis.
In my vi, I define the task at the top as Master like in the article. I have a doubt about how to set "source" of DAQmx Timing at the top (Master task). I chose "OnBoard Clock" but it's not clear if I need to configure it like that in the article.
Another details : to check if the 2 channels I read are in phase, I loop back an AO card located on the same chassis as my two AI cards. Could this be the source of the problem? I created an indepenant task in NI MAX to inject a sine wave. The sine wave generated is connected in parallel to my two AI channels. No reason to be different if the synchronization works correctly.
06-19-2023 02:30 PM
Well, I think I found it. It was all in the spec sheets. Mixing 16 bits and 24 bits resolution together is not a good fit. These specs explain everything I observed. Anyone to confirm?
06-19-2023 02:41 PM
Seems like you are trying to set both modules to use the sampling rate of 50kS/s, you could just put all of them into a single task, like in Figure 4 of Signal-based Synchronization of Analog Input C Series Modules with NI-DAQmx in LabVIEW
06-19-2023 05:33 PM - edited 06-19-2023 05:33 PM
Yes, I did it with a single task initially and that is how I'm going to do it but I will get extra hardware since there's no software solution to my problem.