Go to Post I never wanted to be a teacher. This was the year I learned that I am one. It turns out mentors are teachers. Oops. - marshall [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 27-01-2014, 10:34
wre136's Avatar
wre136 wre136 is offline
Registered User
AKA: Will Edds
FRC #2461 (The METAL-SKINS)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2002
Location: Oklahoma City
Posts: 30
wre136 is an unknown quantity at this point
Getting Input from Serial Interface

I am looking to get data from the serial interface on the cRIO. However, I am having some issues.

I can use the open serial VI and the read serial VI (WPI Robotics Library-> Communications -> Serial Port). However, I'm not sure how to read data. The Read VI allows me to select the number of bytes I want to read. I'm not sure how much to read. We are connecting the CH Robotics UM6 Position sensor (Attached is its datasheet) to the serial and the packet lengths can be anywhere from 7 to 71 bytes in size depending on what length is given in the Packet type header of the packet.

I can say "always grab 7" but since not all packets are that length, I may not grab all the data I need and that will mess up the read of another packet. In addition to that, most of the packets I grab are not structured right. I might grab a data where the packet starts half way through the data, meaning I have an incomplete packet now. I'm not sure how to grab the bytes from the serial and have the code figure it out as I go.

To make things simple, I need to know a good strategy on how to grab the correct amount of data from a serial port and read it to decide how much more data I need to get, and then continue to get that amount.

Would a state machine do the trick or is there a better way to do this? I am a complete novice at data communications.
Attached Files
File Type: pdf UM6_datasheet.pdf (1.39 MB, 7 views)
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:56.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi