Jump to content

Chthonicdark

Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Chthonicdark's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks for the help thus far, due to the time difference here i must get some much needed sleep... before i return to labview. Answer to previous post: spacing of the hex data is not required...
  2. Ok, i think we need to take a step back first.... before we can go forward with the program. Problem 1) This string is what i want Labview to show me... 7E 00 1C 83 56 78 22 00 05 06 00 etc... at the moment it is showing me this <picture attached...> context of the problem... Using the Xbee... in X-CTU data is shown correctly when "shown in hex" otherwise in ASCII (i assume its called ASCII coding, might be wrong) it is useless.... i think this is where i must of confused you. lets get this sorted out before we continue the discussion...thx sorry if i have confused you...
  3. not sure i fully understand what ur trying to say... (my mind is just ready to explode... not ur fault just stressed out atm) String to Byte Array - won't that just convert ASCII rubbish directly into a byte array, what i need is ASCII input from the VISA serial to convert to Hex string...and then process it from there (i'll take a look at this function when i get a chance) Also, quote "One change I would make is to cast the string to an array of U16s as soon as possible" /unquote. if entire data string is converted to U16 before i process it, i forsee a problem: unwanted header bytes = 11 bytes< 7E 00 1C 83 56 78 22 00 05 06 00 > <useful data begins here> <unwanted byte> if I convert to U16 (hex format) = 7E00, 1C83, 5678, 2200, 0506, 00... first byte of useful data would be attached here and that would just screw up the rest of the sampled data...
  4. Using Labview 8.0 Trying to read some serial data using the "Serial Read and Write.vi" Problem is that data is in hex format and labview seems to be reading it as ASCII and outputting gibberish... Is there a way to change the serial data input into hex? --- Also, second problem is not sure how to strip the first 11 bytes so that the useful data afterwards can then be processed for display. ... At the moment i can read the whole input string from the serial port and convert it to 2 byte data for display on a graph... but been scratching my head as to how to remove the first 11 bytes Serial Data in Hex Format 7E 00 1C 83 56 78 22 00 05 06 00 00 00 00 00 00 00 00 00 00 00 FF <read from the serial port continuously> unwanted < 7E 00 1C 83 56 78 22 00 05 06 00 > useful data represented by = 2 bytes each (total of 5 samples) after the first 11 bytes <00 00 00 00 00 00 00 00 00 00> unwanted <FF> Current Thinking (flow chart) Read Serial Port -> Convert ASCII to Hex (How?) -> Detect Start Byte -> Strip Next 10 Bytes -> Read Useful Bytes -> Continue/Loop Process... just not sure how to do it... Edit: attached my latest work so far below... Alternative (Refer to attached Serial Read Write Mod 005) Read Serial Port -> Convert ASCII to Hex (How?) -> wait for All 22 bytes to arrive then process string -> strip unwanted bytes -> process remaining bytes as 2 byte data --> additional maths processing etc... --> REPEAT Process for next set of samples
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.