Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

sending commands over rs232 timed through rtsi bus

Hello,

 

We are using an analog (NI-PCI-6723) and digital (NI PCI-DIO-32HS) output card to control our experiments, where the timing is controlled by the clock of the analog card, which drives the digital card over the RTSI bus connection. 

We have a new device in our experiment, which is controlled through command lines over a RS232 line.

My question is, how can I use the clock of the analog card to time these commands over the RS232 line (maybe by using the RTST bus..?) Kind regards,

 

Erik 

0 Kudos
Message 1 of 6
(3,059 Views)

Hi Erik,

 

Are you looking to synchronize the start of the message with the start of an acquisition?  Both National Instrument's and you computer's serial port are designed to communicate asynchronously.  You can export the RTSI bus where you could use that signal to trigger the start of a send or receive sequence, but the start of the communication will not be fully synchronized since it will be timed with software.  

Caleb W

National Instruments

0 Kudos
Message 2 of 6
(3,030 Views)

Hi Caleb,

 

Thanks! Can you tell me how to export the RTSI bus, so I can send the command after a certain amount of clock cycles?

 

I would preferably use the RTSI bus as a input-clock, where I will count a certain amounts of clockcycles and then send the command. Maybe it's not perfectly synchronized, but it might be good enough. Can this be done?

 

Cheers,

 

Erik 

0 Kudos
Message 3 of 6
(3,013 Views)
Hey Erik,

In order to synchronize the two devices they must share a common reference clock and the tasks must start at the same time. This can be done by sharing the reference clock and a start trigger between the devices over the RTSI bus. You can see an example of this by going to the NI Example Finder in LabVIEW at Help » Find Examples » Hardware Input and Output » DAQmx » Synchronization » Multi-Device » Multi-Device Synch-Analog Input-Cont Acquisition.vi. Although this example if for Analog Input, you can at least see how we share the reference clock and start trigger (make sure to look at the PCI M-Series case).

I am not really clear on what you want to export to the RTSI bus after a certain amount of clock cycles. Can you give more details about this and what this "new device" is? A big picture description of your application may be helpful. Also, you can export signals over the RTSI bus with the Export Signals VI and select RTSI0, RTSI1, etc. Is that what you are looking for?
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 4 of 6
(2,998 Views)

Hi Chris,

 

Thanks! I know how to sync two NI devices (the clock of an analog card drives a digital card using the RTSI bus in our case) and we use this to sequence our experiment.  What  I would like is to add is the serial port into this sequence.

 

So I would like to send a command over de serial port at a specific time, determined by the clock of the analog card. So can I somehow do that using the RTSI bus? Do I perhaps need to buy, for example, the PCI-485 cards?

 

A (dodgy) way is to 'solve' this is to start the sequence together with a timed loop, determined of course by the clock of the computer and therefore leading to inaccuracies. I'm sure there must be a better way.  

Thanks for you help,

 

Erik 

0 Kudos
Message 5 of 6
(2,995 Views)
Hey Erik,

I don't believe you will be able to trigger one of the PCI-485 cards. This would have to be done in software and you are correct that this is not very accurate. One option would be to implement this with PCI-485 on a real-time system. This would make it deterministic.

Another option would be to implement the serial communication on an FPGA. This would allow you to completely customize the timing.

Real-Time Measurement and Control
http://www.ni.com/realtime/

Multifunction NI R Series Intelligent DAQ Devices
http://sine.ni.com/nips/cds/view/p/lang/en/nid/202005
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 6 of 6
(2,980 Views)