Solved

How to send characters to a pole display using Microsoft access

Posted on 2006-11-18
8
2,211 Views
Last Modified: 2011-09-20
Hi.
I have developed a POS system using Microsoft Access.  As the items being sold or refunded are scanned by a bar code scanner into the program, I would also like this information displayed on the LD9000 Series Logic Controls Pole Display.  The pole display is connected to comm3.  At this point in time I am not sure what code is required by my program to send the discription and cost of the item to the pole display.    Can someone help me.

RowenaB
0
Comment
Question by:rowenab
  • 5
  • 2
8 Comments
 
LVL 27

Expert Comment

by:MikeToole
ID: 17974022
The Logic Controls web site has some guidance:

http://www.logiccontrols.com/web/prodCustDtech.htm#q2

<
...
Q. How do I send out characters to my pole display using Visual Basic?

A. Here is a sample code for sending characters via the COM1 port at 9600 baud. Please note that your settings may differ depending on your system configuration.
MSComm1.Comport=1                            ‘ sets port variable to COM1
MSComm1.PortOpen=True                      ‘ opens the port for communication
MSComm1.Settings=”9600,N,8,1”            ‘ sets the protocol to match the pole display
MSComm1.Output=Chr$(31)+Chr$(17)      ' Reset & set normal display model
MSComm1.Output=Chr$(67)                   ‘ sends a sample character to the pole display
MSComm1.PortOpen=False                     ‘ closes the port
...
>
If you want more you could contact their tech support team:

 <If you need further information, please e-mail your question to Logic
 Controls' Technical Support team at: support@logiccontrols.com or call us
 at 516.248.0400. Phone support is available Monday thru Friday from 8:30am to 5:30pm
  EST.  One of our trained technical staff will assist you with your questions.>
   
 
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 17974108
Place an MSComm control on a form.
In a module: paste this

Global Const constPD_VerticalScrollMode As Integer = 18
Global Const constPD_NormalDisplayMode As Integer = 17
Global Const constPD_BrightnessControl As Integer = 4
Global Const constPD_BackSpace As Integer = 8
Global Const constPD_HorizontalTab As Integer = 9
Global Const constPD_LineFeed As Integer = 10
Global Const constPD_CarriageReturn As Integer = 13
Global Const constPD_DigitSelect As Integer = 16
Global Const constPD_CursorON As Integer = 19
Global Const constPD_CursorOFF As Integer = 20
Global Const constPD_Reset As Integer = 31
Global Const constPD_MessageScroll_Start As String = "&H05"
Global Const PD_MessageScroll_Stop As String = "&H0D"
 
To send text:  create a button and paste this code:  ('commPD' is the name I gave the MSComm control)


'----- force comm port open -------
    If CommForm.commPD.PortOpen = False Then
        CommForm.commPD.PortOpen = True
    End If

'-----  this resets the port ----
    CommForm.commPD.Output = Chr(constPD_Reset)
'---- turns cursor off
    CommForm.commPD.Output = Chr(constPD_CursorOFF)

'---- normal mode ----
    CommForm.commPD.Output = Chr(constPD_NormalDisplayMode)


dim s as string
s = "testing"

'----- sends text to pole display -----
CommForm.commPD.Output = s

'----- sends line feed ---
    CommForm.commPD.Output = Chr(constPD_LineFeed)

'---- send carriage return ----
    CommForm.commPD.Output = Chr(constPD_CarriageReturn)
s = "second line"

'----- sends text to pole display -----
CommForm.commPD.Output = s



the port is still open.  You can close if you wish - but you must open again (see first command in this example)


Scott C

0
 
LVL 20

Expert Comment

by:clarkscott
ID: 17974116
Something else......

'CommForm' in the previous example refers to a FORM OBJECT I created.
The MSComm control doesn't reside on my POS screen (since I use it in various places\forms)

In the module that contains all the constants (previous example) I have this code:

Global CommForm As Form


I created a form that contains only this control and is hidden.
When the program starts up and this form is opened, I code like this


Set CommForm = Forms!frmComm_Objects

Now that the 'control form' is global, I can refer to it in code.

Actually the commands I've described in the previous example all reside in their own procedures.  I call them as I need them, such as:


   
    Dim j As Integer
    Dim s As String
    Dim s1 As String
    Dim tb As Integer
    '----- force comm port open -------
    If CommForm.commPD.PortOpen = False Then
        CommForm.commPD.PortOpen = True
    End If
   
    Call PD_Reset
    Call PD_CursorOFF
    'Call PD_VerticalScroll
    Call PD_NormalMode
   
   
    s = LOCAL_LedDetail_Data("Description")
    s = UCase(s)
    CommForm.commPD.Output = s
    If Len(s) < 20 Then
        Call PD_LineFeed
        Call PD_Return
    End If
   
    s = "$" & Format(LOCAL_LedDetail_Data("LedSoldPrice"), "#,###.00")
    If glbMinusValue = True Then
        s = s & "-"
    End If
   
   
    If LOCAL_LedDetail_Data("LedQTY") > 1 Then
        s1 = "x " & LOCAL_LedDetail_Data("LedQTY")
    End If
    tb = 19 - Len(s1)
    tb = tb - Len(s)
    s = s1 & Space(tb) & s
    CommForm.commPD.Output = s

Of course, some of this code won't be recognized by you since it's specific to my prog..... but this may get you started.


Scott C



0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rowenab
ID: 17985150
for Mike Toole:  I already visited the Logic Controls web site, and thats all the information I got, when I contacted them, they told me they cannot help any further. Thanks for your help.

Clark Scott:
You have certainly pointed me in the right direction.  I don't know anything about modules and calling procedures.  I would have to familarize myself with this type of coding before I can continue with sending characters to the pole display.  If there are any other tips you can give me to help speed up the process, I would greatly appreciate it.  Thank you for all your help
0
 
LVL 20

Accepted Solution

by:
clarkscott earned 500 total points
ID: 17985679
Depending on what you want to send to the pole... you may have to 'arrange' your 'pole requests'.

For instance, some times you may want to use the second line of the pole.  In order to do this you need to send a LINE FEED and a CARRIAGE RETURN.

Click on MODULES and select NEW.

In the first screen (Declarations) paste the list of CONSTANTS in my last comment.

At the bottom of the list......

type -

Sub PD_Reset()        (then hit <enter>).  The screen will look like this.

------------------------------------
Sub PD_Reset()

End Sub

-------------------------------------

In between the Sub - End Sub  type

Sub PD_Reset()
-----  this resets the port ----
    CommForm.commPD.Output = Chr(constPD_Reset)

End Sub


To create another sub, simply drop down BELOW the End Sub and do another one.  You can have as many Subs\Functions as you like.

When you click the SAVE button, Access will ask you to NAME THE MODULE.  You can give this any name.  You will NEVER use the Module Name in code.  You WILL, however, use the SUB\Function name.

You can build as many subs\functions in as many separate MODULES as you like.  There is no heirarchy in these... they are all 'equal'.  The advantage of using several MODULES (instead of placing all your sub\functions in a single module) is simply for organizational purposes.


Do this for each of the commands I showed you.  When you need to send this command to the pole, simpy call the sub

call PD_Reset


ps (PD = Pole Display)

Obviously, I cannot give you an entire Sub\Function class in this space.... but I hope this gets you in the right direction.


Scott C
0
 
LVL 27

Expert Comment

by:MikeToole
ID: 17994621
RowenaB
Well, it was just a longshot - sometimes the obvious is missed.
Cheers,
Mike
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 17999891
Hey, it's a comm device and they sent all the required information.  There is no simply "send text to pole" command.  Just like any other PLC type instrument, you have to deal with it in it's terms.

Sorry..... that's just the way it is.

Scott C
 
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 17999896
Further...

You guys should have been around before Windows....
A lot was this way

Scott C
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question