Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

I need some help using USB to RS232 converter with Visual Basic 6

I am trying to communicate with a custom microprocessor using the USB-RS232 converter and Visual Basic 6.  All I need to do is to send and receive hex strings.  I worked out the hardware interface and voltage levels, as I can send and receive data through NIMAX.  However, I am having trouble reading back data in VB6 using the MSCOMM control.  Any guidance or assistance or sample code would be appreciated.  

 

Thanks,

Joe P.

0 Kudos
Message 1 of 3
(3,807 Views)

Hey Joe,

I found a KnowledgeBase article that goes over how to use VB with Serial communication, let me know if this helps 

 

http://digital.ni.com/public.nsf/allkb/6E516A72B648340286256DA5005FA553?OpenDocument

 

Be aware of the potential to get Runtime Error 28: Out of Stack Space, here is a KB that would help resolve the issue

http://digital.ni.com/public.nsf/allkb/FE1960ABD174292B862571E1007926EE?OpenDocument

 

Good luck with your application

 

BeauH
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,792 Views)

As it turns out the problem was not the coding in VB6.  The lack of handshaking and the way the processor operates makes a direct interface with a test script not possible.  The firmware in the processor really needs to be modified to support some sort of testing or test mode of operation.   As it turns out, communication with the device was working, but without getting into too many details there were timing and buffering issues that were causing errors and which could not be resolved.

 

Thanks!

0 Kudos
Message 3 of 3
(3,771 Views)