Sign in to follow this  
Followers 0
mikespeck

1746-BAS to print string file on printer

6 posts in this topic

I'm generating a string within my ladder logic that I would like to send to a printer to be printed via a 1746-bas card. Could anyone support me on how this can be accomplished. A simple PLC .rss program and a Basic program for the module would be nice to review so I can see and watch what is happening in the logic. Then I could familiarize myself and hopefully understand the concept a whole lot better.

Share this post


Link to post
Share on other sites
The BAS module has to be programmed "internally", using an ASCII terminal (such as hyperterminal). There are only a few "bits" that are usable by the PLC, otherwise all of your data transfers are handled through the M0 files (whether read or write). So aside from monitoring "handshake" bits, you will see very little happening in the PLC, as all of the work takes place within the BAS module itself. You can watch what the BAS "sends" out of the serial port using hyperterminal as well, if you are connected to the port that you configure for this function. I am attaching the AB manual for the BAS module, to help you along. BASIC Modules.pdf

Share this post


Link to post
Share on other sites
I'm using Hyperterminal to program the basic module. With the following basic program . . . 10 REM 15 REM 20 MODE (PRT2,9600,N,8,1,N,R) 30 Push 4 40 Push 1 50 Push 0 60 Push 0 70 Push 1 80 Call 23 90 Pop S 100 If S=0 Then P."Call 23 setup successful" 110 If S=1 Then P."Call 23 Disabled" 120 If S=2 Then P."Call 23 Bad Input Parameter" 130 If S=3 Then p."Call 23 Prt2 is chosen but enabled for DF1 Protocol" 140 If S=4 Then P."Call 23 String is to small" 150 If S=5 Then P."Call 23 string is not dimensioned" 160 Push 10 170 Call 56 180 Pop s 190 If S=0 Then P. "Call 56 Logic Processor in Run mode" 200 If S=1 Then P. "Successful Transfer, Logic Processor in Program mode" 220 If S=10 Then P." Illegal length specified" 230 If S=11 Then P." Logic Processor does not support this capability" 240 REM*********************************** 250 Goto 240 260 End Now what I want to do is send a string saying lets say todays date to the basic card where the basic will transfer todays date to a printer that will print the string, just not sure how to do this. Even if my basic program is correct.

Share this post


Link to post
Share on other sites
Refer to attached example, substitute the N7 file reference with an ST file (string) and build your strings with whatever data you wish, up to 40 bytes per execution of the instruction. Whatever you copy to the M0 file will be "pushed" out of the BAS PRT1 serial port. PRINT FROM BAS.xls

Share this post


Link to post
Share on other sites
That's It!!!! Exactly what I was looking for. This will be easy to manipulate and adjust to my needs. Thanks again.

Share this post


Link to post
Share on other sites
You're welcome, glad I could help. Welcome to the Forum.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0