
Page : 18
ETX
STX
Address
Polarity
6th digit
5th digit
4th digit
3rd digit
2nd digit
1st digit
ETX
Power up
Next message
Start
addressing
Start
message
Instrument
address
Polarity
Overload
Character to
be placed on
digit MSB
Character to
be placed on
digit LSB
End of
message
10.2.- STROBE OPERATING MODE, PROGRAMME EXAMPLE
ESC : Resets display to its power-on condition. Has priority
over any other character.
Address : Configured on the switch selector S4 (+30 hex).
All the units with the address, "0" (ASCII 30
hex), will display all data, including the address
code sent, and this address will cause any unit
to receive data.
Polarity : The middle bar is light-up.
Overload : Led located over the polarity bar is light-up.
/* =============OMEGA Engineering Inc.==============
/* Demo programm for series LDP-XX-S connected to a PC */
/* Example of comunication in Strobe operating mode using STX/ETX */
/* To be used under Turbo "C++" of Borland Version 1.01 */
/* Fema Version 01, realized on Dec 1th of 1997 */
/*mode strobe*/
#include<bios.h> /*
#include<conio.h>
#include<stdio.h>
#define COM1 0 /*
#define COM2 1 /*
#define TRUE 1
#define FALSE 0
#define EVEN 0x18
#define ODD 0x10
#define NONE 0x0
#define BIT7 0x2
#define BIT8 0x3
#define STOP1 0x0
#define STOP2 0x4
#define BAUD300 0x40
#define BAUD600 0x60
#define BAUD1200 0x80
#define BAUD2400 0xA0
#define BAUD4800 0xC0
#define BAUD9600 0xE0
int main(void)
{
int count,DONE=FALSE; /*counter & end loop condition
char dat1,men1[25]; /*temporary data and string*/
ciscr(); /*Clear Screen*/
/*__________Initializing Host port________________*/
bioscomp(0,(BAUD9600 | BIT8 | NONE | STOP1),COM2); /*open COM2 port*/
/*__________Initializing instrument_______________*/
bioscom(1,'\x3', COM1); /*Start addressing (ETX, also XOFF)*/
*/__________Main loop of the programm_______________*/
while(!DONE){ /*start transmmision loop*/
/*__________Read message introduced using the keyboard________________*/
count=0
/*reading the string introduced using the keyboard*/
gotoxy(10,3);
printf("enter the mesage (0-7 characters)"); /*Until press Enter key*/
do{
dat1=getche();
Men1[count]=dat1;
count++;
}while (dat1!='\x0d);
men1[count]='\r';
/*_________Send the message and present it on the screen_____________*/
cirscr();
{
bioscom(1,'\x2',COM2); /*Send STX*/
gotoxy(12.10);
printf("STX");
bioscom(1,'0' , COM2); /* Send address*/
printf("0");
count=0
/*_______Message Loop Transmmision_________*/
while (men1[count]!='\r'){
/*Covert to capital letters to see the small letters*/
if (men1[count]<123 & men1[count]>96) men1[count]=men1[count]-32;
*/Print on the screen and send every message character to the port until carriage return*/
printf("%c", men1[count]);
bioscom(1,men1[count],COM2);
count++;
};
bioscom(1,'\x3',COM2); /*Send ETX, End of message*/
printf("ETX");
}
}
return 0;
}
' =============OMEGA Engineering Inc.==============
' Demo programm for series LDP-XX-S connected to a PC
' Example of comunication in Strobe operating mode using STX/ETX
' Realizer for Microsoft Qbasic, VERSION 1.1
' Fema Version 01, realized on Dec 1th of 1997
OPEN "COM2:9600,N,8,1,CD0,CS0,DS0,OP0,RS,TB20,RB20" FOR RANDOM AS #1
'Open port 2 without protocols, 9600, 8, none, buffers for 20 characters'
CLS
PRINT#1,CHR$(3)
DO
LOCATE 10,5
INPUT "Enter message"; A$
A$ = UCASE$(A$)
'Conversion to capital letters'
CLS
LOCATE 12,5
PRINT "STX 0" + A$ + " ETX"
'Print string on screen'
PRINT #1, CHR$(2) + "0" +A$ + CHR$(3) 'Send string to the port'
LOOP WHILE NOT (A$="")
'Until empty string is entered'