LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The serial configurae port Icon dosent work

Hi to you all
 

I’m trying to writhe and read from com1 (serial) I used the serial configure port Icon in order to config what i nead and i show that i cant config the "Serial Settings:End Mode for Writes" at all, i understand that i need to config it so the serial will work, now the serial doesn’t work at all (gives the error that he cant get to the com1 at all) , do i need to config the  "Serial Settings:End Mode for Writes" and if so than what do i writhe ?

0 Kudos
Message 1 of 7
(3,545 Views)

You don't have to configure the serial end mode for writes. It is convenient to do so though when your instrument requires a single termination character such as CR or LF. When you have that configured, you don't have to add this termination character to your writes by modifying the write string. If you need both a CR and LF, then it's easier to just use the concantanate string function or have '\' Code Display enabled on your string constant/control.

I'm not sure what you mean by you can't configure it though. The VISA Configure Serial Port can be modified (be sure to do a save as and in a new location) or you can do it exactly the way that it's done in the Advanced Serial Write and Read example. What is the exact error code that you are now getting?

0 Kudos
Message 2 of 7
(3,535 Views)
Do you currently have your Com port open in another application such as hyperterminal?  If you have a VISA control where you can select which com port to connect to, you can see if the Com port is open when you click on the drop down list.  An open port will have a a pair of computers icon showing up next to its name.  Also make sure to close the com port at the end of the program when you are done using it.  Otherwise other programs can't open it until you completely shut down labview.
0 Kudos
Message 3 of 7
(3,527 Views)

Hi

When i send a command in the direct serial to the device he accept it only after i press the "Enter" button, when i send the same command with Lab View using the serial Icons the unit don’t accept the command because i don’t send here the "Enter", if i return to the direct serial and press the "Enter" button only then i see the replay = the unit accepted the command.

So how do i send a "Enter" after every command using the Lab View serial Icons ?, i  think i need to add  "Serial Settings: End Mode for Writes" to the serial configure port Icon but what do i writhe to it ? What is the number or string that represent the "Enter"? 

 

0 Kudos
Message 4 of 7
(3,517 Views)
Concatenate the appropriate character to the end of your write string.  Or it could be put into the string.  Use Hex display or \codes display to help visualize it.

Message Edited by Ravens Fan on 10-01-2007 02:15 PM

0 Kudos
Message 5 of 7
(3,516 Views)
And you should also determine whether the instrument needs both CR and LF. This should be in the instrument manual. If you do, do what Ravens Fan says. If not, do what is done in the Advanced Serial Write and Read shipping example. In there, the termination character is set to xA or the LF character. If you need a carriage return, you use xD. In hyperterminal, pressing the enter key sends both but your instrument may not require both.
0 Kudos
Message 6 of 7
(3,506 Views)
Hi
 
thank you all fror your help, i now can communicate with the serial port
 
 
0 Kudos
Message 7 of 7
(3,479 Views)