Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
html
Home Protocols Link Drivers Interfaces Features FAQ Prices IOServer Users
Pilih Bahasa ▼
Q : We have various equipment (IEDs (Intelligent Electronic Devices) such as such as relays, transient recorders, meters) that supports operator commands via a
terminal or terminal emulator. These are generally simple ASCII messages command and response.
We wish to extract data from the replies and present this information on an OPC server.
Please advise if you have an OPC server product that allows scripting, wizard, or other methods of manipulating simple ASCII strings in the above command-response
manner without having to code up your own OPC server. We wish to extract the data such as frequency error and time deviation, time tag with the time returned in the
message and present as "tags" in the OPC server etc as if received via a protocol. The commands are very simple - for instance an Arbiter 1093 GPS satellite clock.
where:
ss = status, 1st character 0 = locked, 1 = unlocked, 2nd character = IEEE P1344 status
+f.ffff = signed frequency error in Hz
+t.ttt = signed time deviation in seconds
ppp.pp = phase angle, 0 to 360 degrees
L = local time, U = UTC
We would also like to be able to send a 'command' plus a 'value' as an ASCII text string to the satellite clock.
The 'value' such as in the set time deviation command ASCII string
s.fsRD
where s = 0 to +/- 2000 seconds
fs = fractional seconds
RD = the set deviation command
We would want the ability to enter the seconds 'value' into the tag prior to sending the command.
Writing any value to Data.Mode will cause the string "B7<lf>" to be sent to the GPS. All incoming data will be matched against the pattern defined after "Read". The
[length] in the String definition is the number of bytes including the terminating zero to be allocated for that string.
The deviation can be changed by writing to Data.SetDeviation. The "%6.2f" is a C - style string formatting syntax meaning print the data in floating point format with two
decimal places.
Q : I need help with the .def file to correctly parse the data stream that is coming from an Avtron linear foot counter, unsolicited, every .5 seconds in the following
format:
Read \x10\x02\xff\x01\x3e123.456\x10\x03
Where:
1 of 4 2/15/2019, 9:39 PM
IOServer ASCII Driver FAQ http://www.ioserver.com/ascfaq.html
If message type is not 3e, then discard. I am only interested in capturing the ASCII floating point field.
A : Try
Data
Read \x10\x02\xff\x01\x3e(%f)\x10\x03
Real Value $1
Q : I have an IQ Plus scale interface, which emulates a Mettler-Toledo scale, It send the following string
[STX]*[SP][SP]000179000000[CR]
What is the way to extract the substring of the first 6 digits of 000179000000 (the second 6 digits is tare, which is not used), I want to extract: 000179
The motion variable is actually a binary, that depending if it is a 1 or a 0 tells us if the scale is in motion, if it is kilos or pounds, etc., e.g.,
[SP] = 00100000 or when in motion "(" = 00101000.
[STX]*[SP][SP]000179000000[CR]
[STX]*([SP]000173000000[CR]
A : Try
Input
Read \x02\x2A(.)\x20(%06u)\d+\x0D
Digital [6] "Motion=3,Metric=5" $1
Real Weight $2
Q : I discovered that if the IQ Plus scale displays a negative number, the tare is not zeros, but spaces. Is there a short cut way to define exactly 6 characters, that can
be either digits or spaces?
A : Try
Input
Read \x02\x2A(.)\x20(%06d)[0-9\x20]+\x0D
Digital [6] "Motion=3,Metric=5" $1
Real Weight $2
The scale indicator is configured to display in pounds with no decimal points and in kilos with one decimal point. How do I accomplish this in the .def.
A : Try
Input
Read \x20G([-+0-9.]+)\x20([lk][bg])\x0D\x0A
Real Weight $1
String Mode[3] $2
Q : Our Fairbanks Scale Digital Indicator Model H90-5200 has the following definition
Input
Read \x20(\d+)\x20([lk][bg])\x20([GTN][RAT])\x0D\x0A
Real Weight $1
String Units[3] $2
String Mode[3] $3
GR = Gross
TA = Tare
NT = Net
But it can be lowercase, denoting that the scale is in motion: ([gtn][rat]) Is there a way to account for this, that is, defining a String Motion[3] (or equivalent) so our OPC
Client can monitor this tag and prevent database updates, until the scale has been stabilized with no motion. The idea is to try to have consistency with our OPC client,
since other scales have a specific motion bit we can detect, separate from the Mode tag.
A : Try
Input
Read \x20(\d+)\x20([lk][bg])\x20([gtnGTN][ratRAT])\x0D\x0A
Real Weight $1
String Units[3] $2
String Mode[3] $3
2 of 4 2/15/2019, 9:39 PM
IOServer ASCII Driver FAQ http://www.ioserver.com/ascfaq.html
Input.Motion will be on if the scale is in motion. This make use of the fact that bit 5 is on for lower case letters. The Digital array size must be greater than or equal to 16
so that the ASCII driver will not interpret the $3 as hexadecimal.
Q : We have two Veeder-Root Series 7910 Electronic Predetermining Counter with RS-422. The request message format includes a Checksum, for example:
SOH 01
Address 03 30 33
Code 00 30 30
Checksum 3C 33 43
EXT 03
"The two character hex checksum represents the negative of the sum of all data including the start character up to the character preceeding the first checksum character,
parity bits are excluded from the checksum calculation.
Can IOServer handle checksums. There is no option to disable checksums, although I do understand that we can disregard them for the response message.
A : The ASCII driver does have the ability to generate and check checksum and crc. All we need to do is to add your checksum sum method to our code library. The
ASCII definition will look something like this
Info
Poll \x01%02u\a00%02X\c(5,0,0,0)\x03
Read \x02%02u\a00\(%u)\x2e%02X\c(5,0,0,0)\x03
Word value $1
%02u\a generate the two digit address, the address is defined by the Address field of the ASCII device.
%02X\c(5,0,0,0) generate the two digit hex negative check sum.
Q : I have a device that returns the numerical (sheet) count in hex (field of 5,with left padding zeros). How do I convert this hex number on the fly so IOServer will
display to the OPC Client the decimal equivalent?
A : Use
0x$1 to convert hex string to decimal
0o$1 to convert octal string to decimal
0b$1 to convert binary string to decimal.
$1 is the default to convert a decimal string to decimal
Q : I have been trying IOServer today with the view to using it to interface between an OPC client and a plain ASCII device. For each datapoint, I am aiming to be able
to send out a string to my ASCII device something like "D3.UAI1.V " I want to read datapoints only when polled from OPC client, I want to extract a value from the reply
string which will be something like "REPLY:24.5" I also want my OPC item name to be that same as the read string. I also need to be able to write a value to the device
with a string like "D3.US5.V=34.5" I envisage having a fairly large def file for a typical project, as I need to use about 500 points. all with fixed but different addresses.
Some will be RO, others R/W. If I understand correctly I would basically have a list of the address/string in the def file. Please can you assist in any way.
A : I have attached a configuration (ascsim.io, ascslave.def, ascmaster.def) that simulate a slave ASCII device and a master ASCII device over TCP/IP.
This configuration show the following.
1. A slave device that will respond to read and write requests from the master.
2. A master device that will issue read and write requests to the slave, only points that are requested by the OPC client will be polled. Use the group update time to
control the polling rate.
3. The read/write attribute are presented correctly.
4. Use array to reduce that size of the .def file. We use metacharacter '\i' to handle array.
5. Use multiple devices to represent Dx
We assume that you need a line feed at the end of each message.
3 of 4 2/15/2019, 9:39 PM
IOServer ASCII Driver FAQ http://www.ioserver.com/ascfaq.html
Add a device to the port for each device required with Device Address set to PP to YY.
Note the use of the quoted string after the Digital array definition to allow the symbolic addressing of each binary flags.
Use \x25 instead of % in the Poll String.
Home | Protocols | Link Drivers | Interfaces | Features | FAQ | Prices | IOServer Users
4 of 4 2/15/2019, 9:39 PM