LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Rs232 Serial communication send and receive

Hi i need help to trace out the error in the RS232 communication:
 
   I have device and it is connected with the Rs232 cable to my PC. I am using the Labwindows CVI
   'serial' example which shows the serial communication using the Labwindows CVI.
  Now my device has several parameters as output. I have to send the string which
  specifies the parameter and fetechs the result or device responce. I use the ComWrt and ComRd functions to get read out that parameters
  and display them in the PC.
  I make sure that the communication is established successfully by using some external softwares.
  Now problem is,
  
    I have to send the "Ctl A" first, then i have to send the password and then i need to check the status.
   1) I have received the proper responce when i sent the equalent string for Ctrl A like "\x01".
      If send the equlent string like 'RS_Password' , and i send the 'RS_status' next to that,
      I am getting the responce from the device like 'RS_Password @'. Actually i am expecting a null string
      or if i feed 'RS_Status' I am expecting the result/device responce as '1'. But i always get the respoce as 'RS_Status@'
      I checked out  both commends by using the external software. I am not sure that the device gives the responce to the PC.
      I am not sure why i could't get read out the values by using the Labwindows CVI.
   2) After sending the 'RS_password' or RS_Status i have to send the 'enter'. I am using '\r\n'. Eventhough i have no proper responce from the device.
       In the Rs 232 serial example.....
    
      
 
 
0 Kudos
Message 1 of 3
(3,755 Views)
I attached my code ....Perhaps it explains my problem better then my test...
 
thanx and Regards,
Venki..
0 Kudos
Message 2 of 3
(3,750 Views)
hello venki,

as it seems the basic communication between the device and the PC works.
what kind of device do you use?
did you test a software, which was developed for the device or something like hyperterminal?

if you didn't test with hyperterminal, try that and see, what response comes from your device. this way you could determine, if the answers you get in CVI are the same as they arrive at the serial port.

kind regards,

robert h
National Instruments
0 Kudos
Message 3 of 3
(3,726 Views)