
adccommunitymod (AutomationDirect) asked a question.
Created Date: April 27,2006
Created By: jarmstrong
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I have been experimenting with basic example in the directnet manual (reads the status of x inputs of a DL06) in VB. I am using a serial port monitor to watch serial port activity as I am sending my inquiry and header info and i see the correct response from the DL06 in the serial monitor (4E 21 06 followed by 06 02 "data " 17,LRC and finally 04). So it seems that my "sending and receving is going ok, but I cannot seem to display the hex data in VB using MSCOMM. ARRRGHHH!!! Could someone post or send there code inregards to mscomm settings and formatting of the recieved hex data?
Created Date: April 27,2006
Created by: jarmstrong
I apologize for my terrible spell checking!!!!! Double AAAARGGHH!!!!!
Created Date: April 27,2006
Created by: testone
Look at the InputMode property and make sure it is 1 for binary. The data you receive in will have to be picked apart to look at each character. You may see a string of length xx but it will look like junk until you loop through each character and get its ascii value.
DN$ = MSComm1.input
For I = 1 To Len(DN$)
OneHexVal = (Asc(Mid(DN$, I, 1)))
Next I
Created Date: May 05,2006
Created by: jarmstrong
Thanks for the reply!! that got it working!!
Created Date: April 27,2006
Created by: jarmstrong
I have been experimenting with basic example in the directnet manual (reads the status of x inputs of a DL06) in VB. I am using a serial port monitor to watch serial port activity as I am sending my inquiry and header info and i see the correct response from the DL06 in the serial monitor (4E 21 06 followed by 06 02 "data " 17,LRC and finally 04). So it seems that my "sending and receving is going ok, but I cannot seem to display the hex data in VB using MSCOMM. ARRRGHHH!!! Could someone post or send there code inregards to mscomm settings and formatting of the recieved hex data?