Jump to content

RS232 Binary Data getting Modified


bmoyer

Recommended Posts

Hi everyone,

I have a utility that I developed using LabVIEW to communicate with a device using VISA over RS232 and there is a mode of the device for sending calibration data which takes data in a binary format. What I have found is that some of the data is being converted before it arrives at the device (using a serial port monitor) - mainly the 0x0d (\r) values are being converted to 0x0a (\n).

I found a VISA property under the "Serial Settings" submenu called "End Mode for Writes" but the default for this property is "None" so this property shouldn't have an effect on my data (but I will give it a try).

Has anyone seen this type of behavior and worked out a fix?

Many thanks,

Bruce

Link to comment

QUOTE (ASTDan @ Oct 7 2008, 09:43 AM)

Wouldn't this reverse the problem? If this is the case, wouldn't that change 0x0a (\n) into 0x0d (\r)?

When I looked into the termination for the VISA Configure Serial Port (Serial Instr).vi, it's setting the "Message Based Settings:Termination Character" property and the help on this property says "This property specifies a character that, when read, causes a read operation to terminate." In my case I am writing data.

Any other ideas?

Bruce

Link to comment

QUOTE (bmoyer @ Oct 7 2008, 10:17 AM)

Wouldn't this reverse the problem? If this is the case, wouldn't that change 0x0a (\n) into 0x0d (\r)?

When I looked into the termination for the VISA Configure Serial Port (Serial Instr).vi, it's setting the "Message Based Settings:Termination Character" property and the help on this property says "This property specifies a character that, when read, causes a read operation to terminate." In my case I am writing data.

Any other ideas?

Bruce

Try setting your termination character to false in the Init serial VI.

Link to comment

QUOTE (ASTDan @ Oct 7 2008, 07:33 AM)

Try setting your termination character to false in the Init serial VI.

My understanding is that the termination character only affects read operations. How are you setting your input string control ('\' code display, hex display, normal display). I wonder if this could be having an effect on things?

Link to comment

In my experience a hardware "guy" will first blame the software before admitting fault, in this case, the software "guy" (me) incorrectly blamed the hardware "guy".

My utility loads a binary calibration file and then sends the data to the device. I incorrectly assumed that the Read from Text File function would leave my data unaltered (similar to the Read Characters from File function (now obsolete in newer LV versions) which has this EOL conversion defaulting to off), but it defaults to convert EOL=on (you have to right-click the VI to see this parameter, it's not an input like the other function). Even better, I guess I could/should use the Read From Binary File function which doesn't have an option at all for this conversion.

Thanks to all who replied for their valuable insight!

Bruce

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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