Many
Manuals
search
Categories
Brands
Home
Rockwell Automation
Equipment
1746-BAS BASIC LANGUAGE
User Manual
Rockwell-automation 1746-BAS BASIC LANGUAGE User Manual Page 14
Download
Share
Sharing
Add to my manuals
Print
Page
/
280
Table of contents
BOOKMARKS
Rated
.
/ 5. Based on
customer reviews
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
Public
ation
1746-
RM001A-US-P
P-6
1
2
...
9
10
11
12
13
14
15
16
17
18
19
...
279
280
BASIC Language
1
Important User
2
Information
2
Table of Contents
3
Table of Contents ii
4
Table of Contents iii
5
Chapter 11
6
Chapter 12
6
Table of Contents v
7
Table of Contents vi
8
Who Should Use This
9
Purpose of this Manual
10
How to Use this Manual
11
Terms and Abbreviations
12
Conventions Used in this
12
Rockwell Automation
13
P-6
14
Language Elements
15
BASIC Line Length
16
Data Types
17
Example 1
18
Example 2
18
Example 3
18
Numeric Data Types
19
Variables
20
Variable Names
21
Variable Types
21
2-6 Data Types
22
Expressions and Operators
23
Expressions and
24
Operators
24
Hierarchy of Operators
25
Arithmetic Operators
25
Divide ( / )
26
Exponentiation ( **)
26
Multiply ( * )
26
Subtract ( - )
26
Negation ( - )
26
Overflow and Division by Zero
27
Logical Operators
28
Relational Operators
29
Trigonometric Operators
30
Functional Operators
31
INT([expr])
32
SGN([expr])
32
SQR([expr])
32
Logarithmic Operators
33
String Operators
34
CHR([expr])
36
Special Function
37
CBY([expr])
38
DBY([expr])
38
XBY([expr])
39
BASIC Commands
41
Control-C
44
CALL 18 – Re-enable the
45
Control-C Break
45
Function
45
CALL 19 – Disable the
46
Control-S
47
Control-Q
48
4-12 BASIC Commands
52
BASIC Commands 4-13
53
4-16 BASIC Commands
56
>PROG1
56
BASIC Commands 4-17
57
>PROG2
57
Variations
63
4-26 BASIC Commands
66
>XFER
66
Command Line CALLs
67
CALL 74 –
68
Battery-Backed RAM
68
CALL 77 – Protected
68
Variable Storage
68
CALL 81 – User Memory
69
Module Check and
69
Description
69
CALL 82 – Check User
70
Memory Module Map
70
CALL 101 – Upload User
70
Memory Module Code to
70
CALL 103 – Print PRT1
71
Output Buffer and
71
CALL 104 – Print PRT1
72
Input Buffer and Pointer
72
CALL 109 – Print
73
Argument Stack
73
CALL 110 – Print PRT2
74
Output Buffer Pointer
74
CALL 111 – Print PRT2
74
Input Buffer Pointer
74
Command Line CALLs 5-9
75
>CALL 111
75
PRT2 Input Queue
75
Assignment Functions
77
Control Functions
85
DO-WHILE
87
DO-UNTIL
88
FOR-TO-(STEP)-NEXT
90
IF-THEN-ELSE
92
7-12 Control Functions
96
Functions
97
CALL 16 – Enable DF1
98
Packet Interrupt
98
CALL 17 – Disable DF1
99
CALL 20 – Enable
99
CALL 21 – Disable
100
Processor Interrupt
100
CALL 26 – Module
100
Interrupt
100
CALL 38 – Expanded
101
ONERR Restart
101
Publication 1746-RM001A-US-P
102
PUSH [0 or 1]
103
CALL 70 – ROM to RAM
104
Program Transfer
104
CALL 71 – ROM/RAM to
105
ROM Program Transfer
105
CALL 72 – RAM/ROM
105
Program in ROM 1
106
Program in ROM 3
106
With ROM 1 selected:
106
Examples
107
ON-GOSUB
110
CALL 14 – 16-Bit Signed
117
Integer to BASIC
117
Floating-Point
117
CALL 25 – BASIC
119
Floating-Point to 16-Bit
119
CALL 88: BASIC
120
Floating-Point to SLC
120
CALL 89: SLC
121
Floating-Point to BASIC
121
POP converted value
122
IMPORTANT
122
Clock/Calendar Functions
123
CALL 41 – Set Clock/
124
Calendar Date
124
CALL 42 – Set Day of
125
CALL 43 – Retrieve Date/
126
Time String
126
CALL 44 – Retrieve Date
126
CALL 45 – Retrieve Time
127
CALL 46 – Retrieve Time
128
CALL 47 – Retrieve Day
128
CALL 48 – Retrieve Day
129
CALL 52 – Retrieve Date
129
PUSH [string number]
130
Status Functions
131
CALL 36 – Get Number of
132
Characters in PRT2
132
CALL 51 – Check CPU
133
Output Image Buffer
133
CALL 55 – Check CPU
134
Input Image Buffer
134
CALL 58 – Check M0 File
135
CALL 59 – Check M1 File
136
CALL 75 – Check SLC 500
137
Controller CPU Status
137
CALL 80 – Check Battery
138
Condition
138
CALL 86 – Check DH485
138
Interface File Remote
138
Write Status
138
CALL 87 – Check DH485
139
Read Status
139
CALL 95 – Get Number of
140
Characters in PRT1
140
Buffers
140
CALL 97 – Enable Port
141
PRT2 DTR Signal
141
CALL 98 – Disable Port
141
CALL 108 – Enable DF1
142
Driver Communications
142
Status Functions 11-13
143
11-14 Status Functions
144
Status Functions 11-15
145
Full-Duplex Modem (FDM)
146
Status Functions 11-17
147
CALL 113 – Disable DF1
148
CALL 120 – Clear module
148
Input and Output Buffers
148
CALL 121 – Get SLC
149
Processor Program ID
149
CALL 121
150
POP [program ID number]
150
Output Functions
151
CALL 23 – Transfer Data
152
Port 1 or 2
152
12-4 Output Functions
154
Output Functions 12-5
155
CALL 28 – Write to
156
Remote DH485 SLC Data
156
• 2 - SLC Typed Write
158
• 0 - CPU output image file
159
• 1 - CPU M0 file
159
• 2 - Internal string
159
handshaking
160
>1 REM EXAMPLE PROGRAM
161
CALL 29 – Read/Write to
163
Module Internal String
163
CALL 31 – Display
164
Current PRT2 Port Setup
164
CALL 37 – Clear PRT2
165
Input/Output Buffers
165
CALL 54 – Transfer
165
BASIC Output Buffer to
165
CPU Input Image
165
CALL 57 – Transfer
166
CPU M1 File
166
CALL 85 – Transfer
167
DH485 Common
167
Interface File
167
CALL 91 – Write BASIC
168
Output Buffer to Remote
168
DH485 Data File
168
Output Functions 12-19
169
12-20 Output Functions
170
CALL 93 – Write Output
172
Buffer to Remote DH485
172
Common Interface File
172
Output Functions 12-23
173
CALL 94 – Display
174
Current PRT1 Port Setup
174
CALL 96 – Clear PRT1
174
CALL 112 – User LED
175
CALL 114 – Transmit DF1
176
CALL 115 – Check DF1
177
XMIT Status
177
CALL 123 – Write to
178
Remote DF1 PLC Data
178
on the PLC-2
180
Output Functions 12-31
181
12-32 Output Functions
182
Output Functions 12-33
183
PH0., PH1
187
12-40 Output Functions
190
Input Functions
191
CALL 22 – Transfer Data
192
CPU Files
192
Input Functions 13-5
195
13-6 Input Functions
196
CALL 27 – Read Remote
198
DH485 SLC Data File
198
• 2 - SLC Typed Read
200
Input Functions 13-11
201
• 0 – Successful completion
204
CALL 35 – Get Numeric
205
Input Character from
205
CALL 53 – Transfer CPU
207
Output Image to BASIC
207
Input Buffer
207
CALL 56 – Transfer CPU
208
M0 File to BASIC Input
208
CALL 84 – Transfer
209
DH485 Interface File to
209
BASIC Input Buffer
209
CALL 90 – Read Remote
210
DH485 Data File to
210
Input Functions 13-21
211
(x2) of remote device file]
212
CALL 92 – Read Remote
213
Interface File to BASIC
213
CALL 117 – Get DF1
215
Packet Length
215
CALL 118 – PLC/SLC
216
Unsolicited Writes
216
13-28 Input Functions
218
Input Functions 13-29
219
CALL 122 – Read Remote
220
DF1 PLC Data File
220
Input Functions 13-33
223
• 0 – CPU input image file
224
• 1 – CPU M1 file
224
• 2 – Internal string
224
Input Functions 13-35
225
13-36 Input Functions
226
13-46 Input Functions
236
Setup Functions
237
CALL 78 – Set Program
238
Port Baud Rate
238
CALL 99 – Reset Print
239
Head Pointer
239
CALL 105 – Reset PRT1 to
240
Default Settings
240
CALL 119 – Reset PRT2 to
240
Setup Functions 14-5
241
String Functions
243
CALL 61 – String Append
244
CALL 62 – Number to
245
String Conversion
245
CALL 63 – String to
246
Number Conversion
246
CALL 64 – Find a String
248
CALL 65 – Replace a
249
String in a String
249
CALL 66 – Insert a String
250
CALL 67 – Delete a
251
CALL 68 – Find the
252
Length of a String
252
String Functions 15-11
253
ERROR: MEMORY
253
Conversion Table
255
Reference Guide
257
within destination file]
258
within source file]
258
[CTRL-C].*4-3
263
[CTRL-S].4-8
263
Index iii
269
Index v
271
Index vii
273
Index ix
275
Index xi
277
Back Cover
280
Comments to this Manuals
No comments
Publish
Related products and manuals for Equipment Rockwell-automation 1746-BAS BASIC LANGUAGE
Equipment Rockwell-automation 1751 SynchLink 4-Port Splitter Block Installation User Manual
(16 pages)
Equipment Rockwell-automation 1753-OPC GuardPLC OPC Server User Manual
(2 pages)
Equipment Rockwell-automation 1757-SWKIT400 ProcessLogix R400.0 Server Installat User Manual
(12 pages)
Equipment Rockwell-automation 1756-L7x GuardLogix 5570 Controllers User Manual
(144 pages)
Equipment Rockwell-automation 1792-OB4E INSTL.INST ARMORBLOCK 4 OUTPUT User Manual
(36 pages)
Equipment Rockwell-automation 1769-IF4XOF2 Compact 8-Bit Low Resolution Analog I User Manual
(104 pages)
Equipment Rockwell-automation 1784-PM02AE-TP0 2 Axis Servo Card Termination Pane User Manual
(8 pages)
Equipment Rockwell-automation 1794-ID2/B INSTALL INSTR 24v FLEX I/O 2 CHANNEL In User Manual
(20 pages)
Equipment Rockwell-automation 1785-KA5P/B DHP COMM. ADAPATER MOD. User Manual
(48 pages)
Equipment Rockwell-automation 1753-IF8XOF4 GuardPLC 1753-IF8XOF4 Analog I/O Modu User Manual
(20 pages)
Equipment Rockwell-automation 1758-RTU202 DataSite Software User Manual FRN 1.2 User Manual
(348 pages)
Equipment Rockwell-automation 1760-SIM DC Simulator Installation Instructions User Manual
(4 pages)
Equipment Rockwell-automation 1756-EN3TR ControlLogix EtherNet/IP Communication User Manual
(28 pages)
Equipment Rockwell-automation 1747-DSN DISTRIBUTED I/O SCANNER User Manual
(40 pages)
Equipment Rockwell-automation 1746-FIO4V SLC 500 Fast Analog I/O/ User Manual User Manual
(94 pages)
Equipment Rockwell-automation 1784-KT2/C INST.DATA COMM.INTERFACE MOD. User Manual
(32 pages)
Equipment Rockwell-automation 1768-ENBT CompactLogix EtherNet/IP Communication M User Manual
(28 pages)
Equipment Rockwell-automation 1792-IB2XOB2E/B INSTL.INST ARMOR BLOCK 2 INPUT User Manual
(36 pages)
Equipment Rockwell-automation 1771-IJ_IK IK ENCODER/COUNTER MODULES User Manual
(68 pages)
Equipment Rockwell-automation Logix5000 Controllers Produced and Consumed Tags P User Manual
(40 pages)
Print document
Print page 14
Comments to this Manuals