From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet -> Rs-232 -> microcontroller // cRIO-9022

Hi,

i'm new to LabView and programming in LV.

I have got cRIO-9022 and i'm going to write an application for it. The idea is to send

steering infromation over tcp/ip to cRIO and through cRIO and his RS-232 port to a microcontroller. The information would be

8 bits, number from 0 to 255, according to received number microcontroller would do specifed action.

I have seen the examples included in LV, but it's at the beginning hard to understand. Has anybody done anything like that?

It would be nice to have a fully functional program to study, but i would be appreciated for a general idea of how to achieve it,

how to make the code most efficent, which metods / queues / loops etc. to use.

 

This site has so many informations, i was trying and hadn't found anything like that, so sorry if there is a similiar topic,

 

Thanks for any help !

0 Kudos
Message 1 of 10
(3,956 Views)

Hi Pauldab,

 

It is great that you are interested in learning Labview and willing to write an application for cRIO-9022, however before you start to programming your cRIO I would recommend you to break your project in parts. First get familiar with Labview environment, and understand how to communicate over Serial (see Serial read write examples) from Labview. Than get more familiar with the cRIO-9022 and understand where and how it is used (http://www.ni.com/compactrio/whatis.htm). Than you could study and understand how to create an application to run on cRIO (http://www.ni.com/compactriodevguide/). After that you'll be able to understand and/or create an application for you cRIO to communicate over RS-232 with pretty much anything, even with microcontroller. I am afraid that you will not find on ni.com THE complete example for your project. You will have to put it together.

 

I am wondering why did you choose cRIO for this application? Do you really need if to communicate with your microcontroller. Wouldn't be enough to use an Ethernet Serial interface?

 

I hope you'll find above information useful.

 

Regards,

Barna D.

National Instruments

0 Kudos
Message 2 of 10
(3,901 Views)

Hi Dobarni,
thanks for replying. I was able to make a basic application to send chars over tcp/ip to cRIO, and then to send them to AVR 8-bit microcontroller to control servomechanism. It is done with template -> producer consumer. Chars are received by cRIO in producer loop from TCP/IP, and then queued and taken from queue and sent over RS-232 to micocontroller in consumer loop. Program works fine :).
Yea i have already found compactriodevguide -> it's about 250 pages 🙂 so i began to read it.

I have chosen cRIO because i have it in my university, and it is going to work in future with
fido explosives detector:

http://www.icxt.com/products/detection/explosives/fido/

and send and analize an analog signal from the detector, and do all the cool stuff that
cRIO-9022 is capable of which i'm just not aware of...yet ;). It's all going to be on some basic robotic platform.

Another question. I'm trying to add to my cRIO USB Wireless adapter: ATHEROS AR5007UG. So far no good. I was trying to add it by choosing: VISA TCP/IP Resource, but all i got was:

measurement & automation explorer is unable to create VISA resource on this system.

Either visa is not installed on this system, or NI-VISA does not support creating new resources on this
type of system

thanks for any help
pauldab

0 Kudos
Message 3 of 10
(3,885 Views)

Hi pauldab,

 

I am glad that you managed to set up communication with your microcontroller and that you are interested to learn about the CompactRIO.

Regarding the USB port on the cRIO 9022, I am afraid that you can't really connect anything else to it except USB pendrives or hard drives, unless you create a driver for your USB device (Wireless adapter) for VxWorks real time operating system (which is running on the cRIO 9022). Find more information about the USB port capabilities on this link.

 

I hope this helps.

 

Regards,

Barna D.

0 Kudos
Message 4 of 10
(3,848 Views)

Hi Pauldab,

 

It is too interesting that you have tried to communicate with Fido explosive detector using cRIO. Have u tried it using USB or RS 232 interface?

If you are able to communicate with the device using CRIO, how it can be done?

 

Thanks in advance

 

regards

Aneesh

0 Kudos
Message 5 of 10
(3,223 Views)

Hi Aneesh,

I have done it by RS 232 interface. It was a long time ago, and i don't rember the details, and even if i was that was a military project so i

couldn't tell you anything important. I have connected my cRIO with Fido Interface Box. The sensor sends a 15 bit frame with 20 Hz frequency. All you have to do is to use National Instruments examples to open RS 232 serial port (e.g. set communication speed etc.) and then you simply get this data.

As farest i rember there is no "flag" that indicates that an explosive material was detected. It just gives you the Raw Data - an "experienced" user from the data tells (from a plot that you make from this samples)  if there is an explosive material or not.

 

You could for example receive the data and plot it in real time in your LabView application. To actually detect an explosive you should use DSP -> i suppose that NI Labview has a great tools for that.

 

Best regards
pauldab

0 Kudos
Message 6 of 10
(3,198 Views)

Dear Pauldab,

 

Thanks for the reply.

 

The serial connector of the device have 32 pins which consists of RS232 connection pins and power supply pins.

The real problem I am facing is that the  RS 232 serial interface connection details is not known to me. If the pin outs of the connector is known, I can do the rest.

Can you just help on this or can you tell me atleast how you got the RS 232 connector details.

 

Thanks in advance

 

Regards

A.Aneesh 

0 Kudos
Message 7 of 10
(3,183 Views)

Hi,

unfortunately i do not have the pinout. But it's not that you can't find them for yourself.  Just just the oscilloscope to probe your connection.

GND will be on the left or right of this connection probably. If you stick the probe into every pin -> you should be able to see a frame every 20 Hz -> easy to find and detect. You will see it even if your GND of the probe is not connected (the signal will be rather poor). Then you can find a pin that will smooth out the signal -> this will be your gnd. Try to play around, cause i don't have the pinout -> i made my custom cable.

Best regards

pauldab

0 Kudos
Message 8 of 10
(3,176 Views)

 

 

0 Kudos
Message 9 of 10
(3,165 Views)

Your reply is empty ;D

 

best regards

0 Kudos
Message 10 of 10
(3,146 Views)