06-18-2012 05:52 PM
Hi, I am trying to achieve simultaneous output across three different output modules. I am trying to send a boolean value to basically turn switches on and off at the same time (or within nanoseconds of each other). My hardware setup consists of an NI cRIO-9024 attached to a cRIO-9114 chassis. This chassis contains one NI 9402 module used to output a boolean signal. This chassis is then daisy chained to an NI 9144 etherCAT expansion chassis. This NI 9144 chassis also contains an NI 9402 module to output a boolean. There is then a Beckhoff Ek1100 module with a Beckhoff EL2202 digital output module attached to it. This is daisy chained to the NI 9144 chassis. An example picture of this configuration is attached in the project pics folder.
Ultimately I have 3 VI's to run this operation. The 9114_FPGA and 9144_FPGA VI's are embedded on their respective FPGA chassis and they are used to output a square wave by alternating a boolean value between true and false. The RT_Host_&_BEK1100_Control.VI is used to output a square wave to the Beckhoff hardware, and also control the other two FPGA VI's. Essentially, pressing the On/Off button of this RT Host VI will toggle all three outputs at the same time. This should have them all output their signal with very little delay, however that is not the case. All 3 outputs were connected to an oscilloscope and the time between output from each module was very large. Around the order of 10-30 milliseconds. This is shown in the attached screen grab picture from the oscilloscope.
What is important here is the synchronization of the output signals, not the generation of a square wave, that was only used to enable easier measurements with the oscilloscope. Ultimately we want to be able to turn many instruments on and off at the same time with very little delay between them, preferably only in the nanosecond range.
I am wondering how I can alter my Labview code to achieve this? Or if there are any other alternatives?
Thanks,
Anthony
06-19-2012 08:25 AM
Hi astmt,
Well just because you using FPGA, doesn't mean you are synchronized. In your app you are using three different worlds of IO and it will be impossible to achieve ns synchronization. A try to explain:
The Host VI uses the Host Interface to toggle the FPGA DO on 9114 and 9144 chassis and runs without timing. The FPGA code for some reason is timed with 100 ms. But the biggest problem is that there is no hardware synchronization between 9114 and your EtherCAT Bus and your EtherCAT doesn't use the Distributed Control Synchronization build into EtherCAT.
First you should have alook to a FPGA example for the 9144 to understand how to use the ECAT statemachine on FPGA and wait for the hardware synchronization event signals. Second you need toi check whether your Beckhoff IO is supporting Distributed Control (DC) . Most likely it does not. If not then you will allways have us jitter.
Third your EtherCAT Host communication needs to run in a timed loop synchronized to the scan engine. Your scan engine gives the sample rate for Ethercat and should be the timeing source for the 9114 chassis as well.
If you realy want three devices with synchronized output and 100 ns jitter you should use three ethercat devices DC enabled. If you use the 9144 you don't have to use FPGA. RSI Variables scan mode will do and is easier to handle.
You should not use your 9114 chassis as sad as that sounds and you can not use devices without DC.
DirkW
06-19-2012 02:49 PM
Hi DirkW,
I apreciate your reply. So basically you are saying that this hardware cannot support the synchronization we want?
I checked to see if our hardware had the distributed clocks feature, and only the NI 9144 had this option. I also replaced the main while loop in the host VI with a timed loop synchronized to the scan engine. This didn't have any effect on the output delays.
You mentioned looking up examples on how to use the ECAT statemachine on FPGA for hardware synchronization. I couldn't find this in the NI example finder, could you point me in the right direction to where I might find some examples?
Also in order to achieve ns jitter, you suggested just switching to DC enabled ethercat devices. For this setup could you recommend a suitable labview compatible real time controller to host these devices?
Thanks!
06-19-2012 03:05 PM
Any NI RT controller except for sbRIO could host the NI ethercat Master driver. For IO you could just use three 9144 chassis daisy chained together and then c-series modules of your choice.
So you have the 9022 controller, you probably cannot use the chassis because of the missing synchronization and you have one 9144 chassis and you are two chassis short and some modules short.
The example I mean are for FPGA and you can find them here. \\Program Files\National Instruments\LabVIEW 2011\examples\indcomecat\IO Scan Synchronization
If you don't want to use FPGA you could just use the variable API directly which would take care of all the protocoll stuff automatically.
DirkW