10-19-2013 09:14 AM
Hi ALL,
I am having a problem in getting a digital output on PXIe-6361 module. Here I describe my both HW/SW setup for the sake of clarity.
I am using LV 2011 on Windows 7 system. I also have PXI-1073 chasis inhousing the PXIe-6361, and to the backplane of the chasis is connected the SCB-68 DIO box.
The intention with the attached VI is to use two input signals from an engine crank axel sensor and generate a digital pulse according to user settings. The signals are CAD (Crank Axel Degree) pulses, which are 360 of them in one engine cycle in my case, and TDC (Top Dead Center) pulse which is high once in an engine cycle. So the user will set values to the program to say on which range of CAD pulses should it send out a digital pulse. So for the sake of clarity I should describe what it means by BTDC and ATDC in the VI. BTDC means "Before TDC" and if we think that the CAD pulses count from 0 - 360 between two consecutive TDC pulses, then a value set 100 BTDC would mean actually a CAD count of 260. ATDC refers to "After TDC" and it should be very clear and forward on how to imagine following the logic I used to describe BTDC values.
OK, so I have been helped by NI engineers to make this attached VI work and still have not succeeded. I would like you, members of the forum, to have a look at the VI and help me out in solving this.
Also, I was thinking if I should be able to use the counter output to generate the digital pulses? Is it possible to reset the counter everytime I have TDC pulses high, thereby effectively limiting the counter to count between 0 and 360? If so, how should I proceed with that?
P.S. The VI attached is in LV 2011 version.
I appreciate your help!
10-21-2013 07:44 AM
Hi Henok,
First of all, the example you have should work fine. You don't need to send a 2D array to the DO write, you can use a single channel multiple samples mode. You can generate DO for 8 lines (port0) with single channel.
I have attached a VI without your specific array, just to show the basic DAQmx code. As you also have a ungoing SR you have this in an email as well. I wanted to post a reply here too so that other customers with the same issue can find help here.
You ask a question regarding generating the DO signal with a counter. This would be possible with retriggerable output. And use the TDC as a retrigger, But for your application the DO with external clock seems sufficient.
Info for the VI: The sample rate should be the fastest rate of your external clock signal, and number of samples you can set to the number of samples in your 1D array to DO write.
10-21-2013 01:34 PM
Hi Jonas,
Thank you for the help. I did get the email in my inbox earlier today, but I will only have the chance to run it up on the engine tomorrow. I am going to get back to you with the updates afterwards.
I have one question though: the way you implemented a 1D array write on a single channel with multiplel lines is perfect and fine as long as I want to write the same data to the three DOs. But in the case where the user wants to set three different arrays for each of the DOs, then one should revert to a 2D array write, RIGHT? Have a look at my little modification on your continuous output VI.
Regards,
Henok
10-22-2013 01:52 AM
Hi Henok,
You can use a 2D array, but you should change the DO task to use "One channel for each Line" so that each row corresponds to values for each line. Then you should use 1 as high value in all of your arrays and not 2 for second line and 4 for third. If you are using bitformat like you do now with 1 for first line and 2 for seconds 4 for the third and so on. I would just keep "one channel for all lines" and have a 1D array and add the three arrays together with a Compound Arithmetic function.
Below I describe in bitformat how this is done. If you look in your code you can see how adding each element together can create and array of these values. A zero would represent a low DO and a 1 would represent a high DO.
MSB->LSB Array value
line2 to line 0
000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7