1747-BAS Stop PRINT spaces

controlconcepts

Lifetime Supporting Member
Join Date
Oct 2008
Location
boston
Posts
300
I have a Pelco camera switcher that I am controlling. All works well if I send (PRINT#) with
PRINT #"2Ma5#a1\a" The port gets 2Ma5#a1\a
However when I try to use a variable in the program MQ2.PRINT
For example MQ2 = 3
PRINT #"2Ma5#a",MQ2,"\a" The port gets 2Ma5#a 3 \a with spaces

Is there a way to use PRINT# and , and not have a SPACE printed. I have looked all thru the manual and cant find anything on this.

Code for reference.
10 REM PELCO CM7600 CONTROLS
20 STRING 10000,100
30 MODE (PRT2,9600,O,8,1,N,)
40 MODE (PRT1,19200,N,8,1,N,)
50 PUSH 10 : CALL 56 : POP S
60 PUSH 100 : CALL 14 : POP MQ1 : REM MAIN INPUT FR SLC
70 PUSH 101 : CALL 14 : POP MQ2 : REM
80 PUSH 102 : CALL 14 : POP MQ3 : REM
90 PUSH 103 : CALL 14 : POP MQ4 : REM
100 IF MQ1=1 THEN PRINT #"2Ma5#a",MQ2,"\a"
110 IF MQ1=10 THEN PRINT #"2Ma5#a1\a" : REM PRESET 1
120 IF MQ1=11 THEN PRINT #"2Ma5#a2\a" : REM PRESET 2
130 IF MQ1=12 THEN PRINT #"2Ma5#a3\a" : REM PRESET 3
140 IF MQ1=13 THEN PRINT #"2Ma5#a4\a" : REM PRESET 4
150 IF MQ1=14 THEN PRINT #"2Ma5#a5\a" : REM PRESET 5
160 IF MQ1=15 THEN PRINT #"2Ma5#a6\a" : REM PRESET 6
170 IF MQ1=16 THEN PRINT #"2Ma5#a7\a" : REM PRESET 7
180 IF MQ1=17 THEN PRINT #"2Ma5#a8\a" : REM PRESET 8
190 IF MQ1=20 THEN PRINT #"sa" : REM STOP ANY PAN OR TILT
200 IF MQ1=21 THEN PRINT #"50La" : REM PAN LEFT
210 IF MQ1=22 THEN PRINT #"50Ra" : REM PAN RIGHT
220 IF MQ1=23 THEN PRINT #"30Ua" : REM TILT UP
230 IF MQ1=24 THEN PRINT #"30Da" : REM TILT DOWN
240 IF MQ1=25 THEN PRINT #"Ta" : REM ZOOM IN
250 IF MQ1=26 THEN PRINT #"Wa" : REM ZOOM OUT
260 IF MQ1=40 THEN PRINT #"1pa" : REM START PATTERN 1
270 IF MQ1=41 THEN PRINT #"1na" : REM STOP PATTERN 1
280 IF MQ1=1000 THEN PRINT #"la PUSHBUTTON PANEL !a4^a"
290 PUSH 1 : CALL 36 : POP POB
300 IF POB<>0 THEN GOTO 320
310 IF POB=0 THEN GOTO 50
320 PRINT "P2 OUT BUFF",POB
330 INPS #$(0),POB
340 PRINT "INPS ",$(0)
350 GOTO 50



Thanks,
Matt
 
Try using a semicolon instead of a comma.

PRINT #"2Ma5#a",MQ2,"\a"

But they may be adjacent. You might have to force a single space.

PRINT #"2Ma5#a";" ";MQ2;" ";"\a"
 
My reply should have read for the first line ...

PRINT #"2Ma5#a";MQ2;"\a"

Another option is to build the non-spaced string, using commands from the 'STRING' chapter, first then PRINT the string.
 
Last edited:
Bernie Thanks for the reply. I tried your first option. I got a bad syntax error. I will reread the STRING chapter. Is there a way to put a variable into a string? I have read the manual many times but must have missed that if there is a way to do so.
Thanks again ,
Matt
 
You'll use CALL 62 to convert MQ2 to a single character string.

You will use CALL 61 to append together the elements into a final string.

It will be something like ... (Note, it's been a while since I've worked with this)

$(1) = "2Ma5#a"
$(3) = "\a"

- The following converts the number in MQ2 to the equivalent string

PUSH MQ2
PUSH 2
CALL 62

- This appends $(2) on to the end of $(1)

PUSH 2
PUSH 1
CALL 61

- This appends $(3) on to the end of $(1)

PUSH 3
PUSH 1
CALL 61

- This should leave the complete non-spaced string in $(1)
- You should be able to print it out the port with

PRINT #$(1)
 
Wow Bernie thanks.. I just found the call 62 an that worked now I am building the string. I t dose not say you can use a variable in the manual but I cave it a try. Caught your post arter I found this out..
Thanks again,
Matt
 
This is what I came up with

If any one needs the code..

10 REM PELCO CM7600 CONTROLS
20 STRING 10000,100
30 MODE (PRT2,9600,O,8,1,N,)
40 MODE (PRT1,19200,N,8,1,N,)
50 PUSH 10 : CALL 56 : POP S
60 PUSH 100 : CALL 14 : POP MQ1 : REM MAIN INPUT FR SLC
70 PUSH 101 : CALL 14 : POP MQ2 : REM MONITOR
80 PUSH 102 : CALL 14 : POP MQ3 : REM CAMERA
90 PUSH 103 : CALL 14 : POP MQ4 : REM PRESET #
100 PUSH MQ2 : PUSH 1 : CALL 62 : REM MONITOR TO STRING 1
110 PUSH MQ3 : PUSH 2 : CALL 62 : REM CAMERA TO STRING 2
120 PUSH MQ4 : PUSH 3 : CALL 62 : REM PRESET TO STRING 3
130 $(4)="Ma"
140 $(5)="#a"
150 $(6)="\a"
160 IF MQ1=1 THEN GOTO 170 ELSE GOTO 250
170 PUSH 1 : PUSH 7 : CALL 61 : REM MONITOR TO PRINT STRING
180 PUSH 4 : PUSH 7 : CALL 61 : REM Ma TO PRINT STRING
190 PUSH 2 : PUSH 7 : CALL 61 : REM CAMERA TO PRINT STRING
200 PUSH 5 : PUSH 7 : CALL 61 : REM #a TO PRINT STRING
210 PUSH 3 : PUSH 7 : CALL 61 : REM PRESET TO PRINT STRING
220 PUSH 6 : PUSH 7 : CALL 61 : REM \a TO PRINT STRING
230 PRINT #$(7)
240 $(7)=""
250 IF MQ1=10 THEN PRINT #"2Ma5#a1\a" : REM PRESET 1
260 IF MQ1=11 THEN PRINT #"2Ma5#a2\a" : REM PRESET 2
270 IF MQ1=12 THEN PRINT #"2Ma5#a3\a" : REM PRESET 3
280 IF MQ1=13 THEN PRINT #"2Ma5#a4\a" : REM PRESET 4
290 IF MQ1=14 THEN PRINT #"2Ma5#a5\a" : REM PRESET 5
300 IF MQ1=15 THEN PRINT #"2Ma5#a6\a" : REM PRESET 6
310 IF MQ1=16 THEN PRINT #"2Ma5#a7\a" : REM PRESET 7
320 IF MQ1=17 THEN PRINT #"2Ma5#a8\a" : REM PRESET 8
330 IF MQ1=20 THEN PRINT #"sa" : REM STOP ANY PAN OR TILT
340 IF MQ1=21 THEN PRINT #"50La" : REM PAN LEFT
350 IF MQ1=22 THEN PRINT #"50Ra" : REM PAN RIGHT
360 IF MQ1=23 THEN PRINT #"30Ua" : REM TILT UP
370 IF MQ1=24 THEN PRINT #"30Da" : REM TILT DOWN
380 IF MQ1=25 THEN PRINT #"Ta" : REM ZOOM IN
390 IF MQ1=26 THEN PRINT #"Wa" : REM ZOOM OUT
400 IF MQ1=40 THEN PRINT #"1pa" : REM START PATTERN 1
410 IF MQ1=41 THEN PRINT #"1na" : REM STOP PATTERN 1
420 IF MQ1=1000 THEN PRINT #"la PUSHBUTTON PANEL !a4^a"
430 PUSH 1 : CALL 36 : POP POB
440 IF POB<>0 THEN GOTO 460
450 IF POB=0 THEN GOTO 50
460 PRINT "P2 OUT BUFF",POB
470 INPS #$(0),POB
480 PRINT "INPS ",$(0)
490 GOTO 50


And if there is any better way let me know..
Thanks again Bernie..
 

Similar Topics

All, I have a 1746-BAS module. Only the DH485 port is configured to pull the program. Does anyone have a copy or know where i can get a copy of...
Replies
6
Views
3,613
Hi everybody, i need help to program a 1746-bas module, I have some backups with extension.bas and i am looking software 1747-winbas. Thanks and...
Replies
0
Views
2,037
Maybe you guys can help I’d like to get to the bottom of this. Here’s my problem: I want to have two RS232/DF1 port’s . I have a SLC 5/03...
Replies
12
Views
7,330
Need Info on using a 1747-BAS module to talk to a Accu-Sort XLT 200 Barcode Scanner. Has anyone tried it, I'm having some prblems and looking for...
Replies
5
Views
2,681
We are in the process of upgrading a controls system. The existing system is a SLC500 with some IO cards and a 1747-SDN module communicating to a...
Replies
5
Views
525
Back
Top Bottom