Print Page | Close Window

Communicating to a USB device

Printed From: Rocket Software
Category: AccuTerm Knowledge Base (read only)
Forum Name: Connectivity
Forum Description: Questions about serial, modem, telnet and secure shell connections?
URL: https://forum.asent.com/forum_posts.asp?TID=1123
Printed Date: March 26 2026 at 8:50pm
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


Topic: Communicating to a USB device
Posted By: ActivantPD
Subject: Communicating to a USB device
Date Posted: August 15 2007 at 2:52am
Does AccuTerm have any abilities to set and communicate with device connected to a USB port.  I have a need to communicate from our HP-UX PICK application with a Point of Sale Display Pole.

Thanks!



Replies:
Posted By: ActivantPD
Date Posted: August 15 2007 at 6:14am
OK, I searched through the FORUM topics and found one that talks about what I may need.  It makes use of the bidirect.atsc script.  I am able to open and send data to COM7 where my Display Pole is connected.

Thanks!


Posted By: Brian Parker
Date Posted: April 21 2008 at 1:32am
I need to do sonthing similar - talk to a device attached to a USB port.

How do you know which COM port is assiciated with which USB port?


Posted By: ActivantPD
Date Posted: April 21 2008 at 2:03am
Brian,

The device we are communicating with is an EPSON Display Pole unit used on a Point of Sale register.

We used the EPSON OPOS Software that comes with the unit to map the USB device to a COM port.



Posted By: Brian Parker
Date Posted: April 30 2008 at 1:10am
I have inherited a Pole Display as well. I am able to send to it via an Accuterm but I am having an issue with timing - for lack of a better word.

If there is keyboard input before the script finishes sending to the Pole display it will not display properly. Sometimes what is supposed to be sent to the pole display is displayed on the screen. I have experimented with InputMode and Input. I have tried having the script send an x to the main session when it has started and another x when it has finished and then having a loop in the main program to wait for the x after initializing the script before sending the data that is to be sent to the pole display and then wait for another x before continuing. The number of characters sent to the pole display is always 49 - 2 rows of 20 characters and 9 control characters.

I have included the script below. How did you overcome this issue? Am I doing something incorrect?

Sub PoleDisplay()
Dim Txt2 As String
Dim Can2 As String
   Dim N2 As Integer
   Dim s12 As Session
   Dim s22 As Session
   Set s12 = Sessions(0)
   Set s22 = Sessions(2)
   s12.InputMode = 2
   s22.InputMode = 2
   Can2 = Chr$(25) 'quit when this character is received
   s12.Output "x" & Chr$(13)
Do
     Txt2 = s12.Input(0, 49, 0)
     N2 = InStr(Txt2, Can2)
     If N2 Or Txt2 = "" Then
       If N2 Then s22.Output Left$(Txt2, N2-1)
            'MsgBox(Txt2 & " " & N2)
       Exit Do
     End If
     s22.Output Txt2
Loop
   s12.Output "x" & Chr$(13)
   s12.InputMode = 0
   s22.InputMode = 0
End Sub


Posted By: PSchellenbach
Date Posted: May 06 2008 at 5:25am
Hi All -

The bidirect.atsc script is mainly used when you need to get input from the device as well as send data to it. In the case of a pole display, it would seem that this is always going to be one way - from host to display. In this case, you can still use a second hidden AccuTerm session that sends data to the display, but your script will be much simpler:
Dim s As Session

Dim txt As String
txt = "stuff you want to display"
Set s = Sessions(2)
s.Output txt
You need to assign the 'txt' variable to the content you want to send to the display, using proper VBA syntax. Also, change Sessions(2) to whatever session is connected to the display.

An alternative might be to configure the pole display as a printer, using the generic/text only printer driver in Windows, and just treat it as a slave printer from AccuTerm. There are some examples of changing the current slave printer using a script on the forum, so that you can have multiple printers - pole display, receipt printer, etc.

Thanks,

Pete



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net