Jump to content

Sending cycle count from a VB computer(1) program


Forrest

Recommended Posts

Greetings:

I have an interesting interfacing problem brewing.

Bad news:

I initially was taking a cycle count thru the serial port from

computer(1) using IBM Basic A (compiled) thru a serial port at 9600 baud. Then i was picking that cycle count with another computer(2) running Labview. The program on computer (1) is finally getting a little obsolite (no ISA ports for cards(3 ea) , cards obsolite (no PCI cards, cannot run Dos 6.2 anymore on new computers, Computer (1) software is not suported anymore. I think i have finally beat the dog to death!

Good news:

There was an upgrade for the software on computer(1) to run on Win XP it is using Visual Basic for control and USB to run an external Box. The third party person is willing to change his program to send cycle counts to either USB and or another form of comunication such as the serial port,(maybe to TCP/IP). Serial port would put a speed limits of the serial port. Also serial ports are going away with new computers. TCP/IP thru VB ??. Maybe even a digital (ttl) lines?. l am wondering which would be the better option into Labview 7.1.1 ??

Any suggestions would be helpful.

Thanks Forrest :wacko:

Link to comment

Forrest,

Personally I like the ease and reliablity of the serial port. Even though the physical 9-pin connectors are going away, you can always purchase a $20 Belkin USB to RS232 adaptor that shows up in Max like any other Com port.

We've been faced with the option to upgrade the communication method on a test box we use. Going USB requires more development on both ends. How does the guy developing the box write USB drivers and how to I interface to them in LV? Like I say, RS232 is simple and for us, already done. Speed is also not an issue for us.

Using a TTL interface means you'll need a DAQ card to acquire the signal (or some combersome parallel port DIO scheme. I'd be interested in learning a simple way to acquire a TTL signal using standard PC hardware, if anyone knows...). If you will always have a DAQ card in the system with your third party box, then maybe it's no problem. I didn't want our box to require a DAQ card in every application.

We didn't investigate a TCP/IP approach but again that adds some level of complexity over the RS232 solution.

Just my two-cents...

-James

Link to comment

Thanks for your suggestions:

How easy it to implement RS232 using Visual Basic on computer(1). I would not use much handshaking... Just dump to the labview computer with a special charactor for the start of cycle counts. Such as $00000020, $00000021,$00000022 ...etc. Either pad with leading Zeros or not.. Possible at max 115K baud. Computers are within 6 feet of each other.

Thanks Forrest :wacko:

Forrest,

Personally I like the ease and reliablity of the serial port. Even though the physical 9-pin connectors are going away, you can always purchase a $20 Belkin USB to RS232 adaptor that shows up in Max like any other Com port.

We've been faced with the option to upgrade the communication method on a test box we use. Going USB requires more development on both ends. How does the guy developing the box write USB drivers and how to I interface to them in LV? Like I say, RS232 is simple and for us, already done. Speed is also not an issue for us.

Using a TTL interface means you'll need a DAQ card to acquire the signal (or some combersome parallel port DIO scheme. I'd be interested in learning a simple way to acquire a TTL signal using standard PC hardware, if anyone knows...). If you will always have a DAQ card in the system with your third party box, then maybe it's no problem. I didn't want our box to require a DAQ card in every application.

We didn't investigate a TCP/IP approach but again that adds some level of complexity over the RS232 solution.

Just my two-cents...

-James

Link to comment

Though I like the simplicity of Serial in general, I would recommend TCP/IP in this situation. It should not be very difficult in VB to send similar commands over TCP. And on your LabVIEW side, you would have a simple TCP Client (single connection listener). You could even modify the shipping examples to suit this for your application. The rest of the code for parsing and interpreting the cycle counts need not have to change.

The advantages of TCP are obvious: can have multiple computers (or applications within a single computer) read the counts, distance is not an issue, and can even go wireless in the future.

My 2 Canadian cents.

-Khalid

Link to comment

Question.. what VB commands could be used in this situation.

Thanks Forrest

Though I like the simplicity of Serial in general, I would recommend TCP/IP in this situation. It should not be very difficult in VB to send similar commands over TCP. And on your LabVIEW side, you would have a simple TCP Client (single connection listener). You could even modify the shipping examples to suit this for your application. The rest of the code for parsing and interpreting the cycle counts need not have to change.

The advantages of TCP are obvious: can have multiple computers (or applications within a single computer) read the counts, distance is not an issue, and can even go wireless in the future.

My 2 Canadian cents.

-Khalid

Link to comment

I second the TCP/IP recommendation, as well as the Googling for VB code samples. For Example:

Google: VB TCP/IP code example

You get a big list, one is at Developer Fusion community forums.

http://www.developerfusion.co.uk/vb/41/

Check the article: A TCP/IP socket server object for Visual Basic - Overview

The author includes code you can cut & paste & modify.

Cheers,

Link to comment

Mike:

Just baught two USB to RS232 cables from USB Gear (model # USBG-232-MM).

I plan to hook them up as: computer1(VB)-->USB--> RS232 <--Null--> RS232 <--USB<-- Computer2(LV711)

and make a null modem between the two USB to RS232 Cables. A Little messy but it should work.

Thanks for your help, and i will down load the snippits for TCP/IP if my solution does not work.

Thanks Forrest :wacko:

I second the TCP/IP recommendation, as well as the Googling for VB code samples. For Example:

Google: VB TCP/IP code example

You get a big list, one is at Developer Fusion community forums.

http://www.developerfusion.co.uk/vb/41/

Check the article: A TCP/IP socket server object for Visual Basic - Overview

The author includes code you can cut & paste & modify.

Cheers,

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.