11-09-2011 04:28 PM
I am quite a noob to cRIO, labview, Xbee..
My current target is to use a xbee module connected to a compact-rio as a receiver to recevie data from other remote modules. And the cRIO will work as a data concerntrator. I have managed to use X-CTU to configure Xbee or do some simple transmission work. Also I found a sample from Labview which is serial write and read vi. It worked with the xbee as much as the X-CTU, though it is not perfect enough. I wonder if it will help in terms of cRIO. I just want to let the crio can interact with the xbee modules for now.
But my main problem is I dont know where to start my job. To study FPGA? Real-Time? Labview?
Please forgive my language
And please help me guys.
THANK YOU VERY MUCH!!!
Solved! Go to Solution.
11-10-2011 05:41 AM
Thanks for joining the community!
You mention that you are using an XBee module - are you communicating with this using serial? If so we would look at using the VISA functions within LabVIEW. I would recommend having a look at the "Basic Serial Write and Read.vi" in the Example Finder ("Help » Find Examples...") - this should give a good starting point.
Although you mention that it is "not perfect enough" doing this within LabVIEW - what do you mean by this?
One final thing, if you are using the serial port on your cRIO controller - you will access this from the real-time side. If you are using a serial module - you will communicate using the FPGA. If you are looking to learn about cRIO in general, one great resource is the CompactRIO Developer's Guide. We also have structured training courses for Real-Time and FPGA programming running at your local office, or online.
11-10-2011 07:47 AM
Thank you Pete!
Yeah I did look into the example vi you mentioned. Bascially I have to add a while loop into the vi to let it work continously and I can read the receiving data from the front panel. However, the string or data just displayed on the screen for a few seconds then it just vanished. It is a good starting point though.
The xbee module should be connected to cRIO via serial port. So I guess I will start from Real-time, right?
Thank you again Pete. You are just brilliant. Cheers!
11-10-2011 08:20 AM
It will only be displayed until you do your next read. If you want to store all the data you can log it to file, or play with the string controls to store data:
The above example adds string data and stores it between iterations.
Yes, you will be using the VISA functions within the real-time environment. The coding practice is actually fairly similar to coding LabVIEW for Windows - however if will be a good idea to study good practices - many of which are documented in the Developer's Guide I mentioned.
Also, no problem!
11-10-2011 02:01 PM
I figured this topic probably warranted a community example.. so I have made one here!
In the above example we are using a shift register to store data between iterations. You can add this to a loop structure by right-clicking the border and selecting "Add Shift Register" - alternatively you can replace standard tunnels with shift registers using the right-click menu.
If a value of "True" is read from the Add Data control, the True case will execute. This generates a random number and uses the "Number to Fractional String" conversion to change to string data type. We then concatenate a carridge return character and the previous string. For example;
Previous String - "Second String
Random Number - "0.253615"
Resulting String - "0.253615
12-08-2011 11:13 AM
It's me again.
Now I have developed a VI to read and extract needed bytes from a received API frame string. It' pretty simple and straitforward. It worked fine before. But today I found it couldn't read a complete string. That's quite odd. I don't know what to do. Hope you can help again.