Discussion:
Problem communicating with Inertial Sensor
(too old to reply)
arthas
2008-08-14 07:10:13 UTC
Permalink
Greetings everyone. I am using a wireless Inertial Sensor from Microstrain company which can measure acceleration, euler angles and angular rate. I would like to acquire all the data from the sensor by using LabVIEW. The microstrain company had sent me some subVIs which allow me to communicate and acquire data from the sensor. Included in this post are the "Initialize Serial Communcations.vi", "Read Accel and Rate.vi" and 1 screenshot.  I was told by an engineer from the microstrain company that I have to first run "Initialize Serial Communcations.vi" first with the correct COM port settings before I can run one of the other vi's, such as "Read Accel and Rate.vi"  to read data. I connected the 2 Vis attached in this post to acquire the acceleration and angular rate data. However when i run the program, an error message saying "VISA: (Hex: 0xBFFF0015) Timeout Expired before operation completed" will be displayed. The screenshot shows the block diagram and the error message displayed. This error also occur when i am using other subVIs provided by the company. How do I overcome this problem? I am very sure that the correct COM port is the one connected to the “Initialize Serial Communications.vi”, which is COM5. I am using LabVIEW version 8.5. Any help would be much appreciated.


Initialize Serial Communications.vi:
http://forums.ni.com/ni/attachments/ni/250/42319/1/Initialize Serial Communications.vi


Read Accel & Rate.vi:
http://forums.ni.com/ni/attachments/ni/250/42319/2/Read Accel & Rate.vi


screenshot1 - block diagram.JPG:
http://forums.ni.com/ni/attachments/ni/250/42319/3/screenshot1 - block diagram.JPG
ninlmartijn
2008-08-14 09:40:20 UTC
Permalink
Dear Arthas, Thank you for your post on our webforum. I understand you have some problems with serial communication. I wasn't able to open Read & Accel VI, because some sub VI's aren't included. The best thing to do is to test your communication in the measurement and automation explorer (MAX). You can find your COM port under devices and interfaces. When you click on the comport which is used you can validate your settings and you are able to open the testpanel and perform some basic I/O. I did see the VI Read and Accel sends the hex code C2 (string Â) to the device and then reads his response. In your VI they use the following settings;data bits: 8parity: nonestop bits: 1flow control: none At this moment you specified a time out from 1 sec. Is it possible to increase this to 10 seconds? Please let me know if it works with MAX, Best regards,  
arthas
2008-08-14 13:40:22 UTC
Permalink
Hello ninlmartijn,  firstly, thank you for your quick reply. I have now attach the 'misisng' subVI needed to run the "Read Accel and Rate vi" in this post. Sorry for any inconvenience caused earlier. Just for your info, the input values of the "initialize serial communication vi" are initially set  by the engineers from microstrain company.  The command byte 'xC2' in  "read accel and rate vi" is to set the inertial sensor to output a data record
containing the Acceleration and Angular Rate Vectors. I have tried changing the values of the timeout(msec) in the "initialize serial communication vi" but eventually, after some time the error message will be displayed. I will let you know tomorrow regarding the testing of the sensor communication in MAX as the sensor is not with me now Thank you 


Evaluate Bytewise 16bit checksum.vi:
http://forums.ni.com/ni/attachments/ni/250/42329/1/Evaluate Bytewise 16bit checksum.vi
ninlmartijn
2008-08-14 14:40:11 UTC
Permalink
Dear Arthas,&nbsp;Thank you for your reply. There was no inconvenience at all. I just wanted to point out that I wasn't able to review the complete code.&nbsp;I hope things in MAX will work. Please use the VISA close VI after your readings. Then the serial communication will be closed (I'm sorry I didn't noticed this before). Pleas try to run the VI with highlight execution to determine&nbsp;at which pont in the VI the time out occurs. I found also a <a href="http://digital.ni.com/public.nsf/allkb/E6DFA2B8D7E99F9886256C14005E82F7?OpenDocument" target="_blank">knowledge base</a>&nbsp;about debugging this error. &nbsp;Best regars,
arthas
2008-08-15 06:10:09 UTC
Permalink
I have tried using MAX and under device status , it says the device is working properly. However, when i try viRead, the knowledge base error code will be displayed, as shown in screenshot 2 attached in this post. Not sure if I have done it correctly here.&nbsp;The error occurs after passing through the &quot;read acceleration and rate vi&quot; as shown in screenshot 3. The &quot;close serial port&quot; subVI in screenshot 3 is to close the serial port. &nbsp;&nbsp;


screenshot2 -MAX.JPG:
http://forums.ni.com/ni/attachments/ni/250/42366/1/screenshot2 -MAX.JPG


screenshot3 - block diagram2.JPG:
http://forums.ni.com/ni/attachments/ni/250/42366/2/screenshot3 - block diagram2.JPG
ninlmartijn
2008-08-15 07:10:08 UTC
Permalink
Dear Arthas,&nbsp;Bad to hear hat things didn't work out.&nbsp; did had a quick look at the Microstain site. I noticed a fast ping.vi in the tools they deliver. Is it possible for you to run this VI. With this VI we can at least verify if the device responses. It is also possible to send the 02 string in MAX and try to see if the device response. &nbsp;MAX tests the everything until the serial port. If MAX says that everything is working properly it means that the serial port is working properly. Please test if the ping works, if it isn't I suspect the problem lays behind the serial port.&nbsp;Have a great weekend,&nbsp;Best regards,&nbsp;&nbsp;&nbsp;
arthas
2008-08-15 08:40:20 UTC
Permalink
Sorry, where did you find the fast ping.vi in microstrain site? I couldnt find it :(&nbsp;If I want to send the 02 string in MAX, does that mean I have to write '02' in the buffer under viWrite tab at MAX? &nbsp;Thank you and hope you have a great weekend too :)&nbsp;&nbsp;
ninlmartijn
2008-08-15 09:10:20 UTC
Permalink
Dear Arthas,&nbsp;I did find a Software Development Kit, the PIN VI is included in the ZIP file. I attatched the VI on this thread. 02 is indeed the string to send. &nbsp;Best regards,


fast_ping.vi:
http://forums.ni.com/ni/attachments/ni/250/42369/1/fast_ping.vi
arthas
2008-08-15 09:10:21 UTC
Permalink
Thank you for the &quot;fast ping vi&quot; . I have tried running it and the response is 02 as shown in screenshot 4 attached in this post. The sensor's node address is 86 by the way.&nbsp;When I run MAX however, the sensor's interface name is no longer listed in COM5 as shown in screenshot 5.&nbsp;


screenshot 4- fast ping front panel.JPG:
http://forums.ni.com/ni/attachments/ni/250/42370/1/screenshot 4- fast ping front panel.JPG


screenshot 5 -MAX.JPG:
http://forums.ni.com/ni/attachments/ni/250/42370/2/screenshot 5 -MAX.JPG
ninlmartijn
2008-08-15 10:40:20 UTC
Permalink
Hello Arthas,&nbsp;The sensor responding is good news. I'm not familiar with these sensors, so it is a little bit searching for me. I noticed we have a USB <a href="http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=371E7E9ACB9D431BE04400144F1EF859" target="_blank">instrument</a>&nbsp;driver for the Agile link products from microstrain. Included in this driver there are some examples which can help to set up our Labview program. Please download the library and open the MSagxlink Continuous LDC example. We never specified the node address probably a VI like continuous stream on / off has to be included in your block diagram. I hope this will help you further. Have a great weekend!&nbsp;Best regards,
Loading...