Omega Engineering LDP-124 User Manual page 18

Table of Contents

Advertisement

10.1.- SHIFT OPERATING MODE, PROGRAMME EXAMPLE
Power up
Start
XOFF
addressing
Start
XON
message
Instrument
Address
address
Polarity
Polarity
Overload
Character to
be placed on
6th digit
digit MSB
5th digit
4th digit
3rd digit
2nd digit
Character to
1st digit
be placed on
digit LSB
XOFF
End of
message
Next message
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.
Page : 17
/* =============OMEGA Engineering Inc.==============
/* Demo programm for series LDP-XX-S connected to a PC
/* Example of comunication in Shift operating mode using XON/XOFF
/* To be used under Turbo "C++" of Borland Version 1.01
/* Fema Version 01, realized on Dec 1th of 1997
/*mode shift*/
#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*/
/*__________Initializing Host port________________*/
bioscomp(0,(BAUD9600 | BIT8 | NONE | STOP1),COM2);
/*__________Initializing instrument_______________*/
bioscom(1,'\x13', COM1);
/*Start addressing (XOFF)*/
*/__________Main loop of the programm_______________*/
ciscr();
/*Clear Screen*/
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)");
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,'\x11',COM2);
/*Send XON*/
gotoxy(12.10);
printf("XON");
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,'\x13',COM2);
/*Send XOFF; End of message*/
printf("XOFF");
}
return 0;
}
' =============OMEGA Engineering Inc.==============
' Demo programm for series LDP-XX-S connected to a PC
' Example of comunication in Shift operating mode using XON/XOFF
' Realizer for Microsoft Qbasic, version 1.1
' Fema Version 01, realized on Dec 1th of 1997
OPEN "COM2:9600,N,8,1,OP0,RS,TB20,RB20" FOR RANDOM AS #1
'Open port 2 without protocols, 9600, 8, none, buffers for 20 characters'
CLS
PRINT#,CHR$(19)
DO
LOCATE 10,5
INPUT "Enter message";A$
A$ = UCASE$(A$)
'Conversion to capital letters'
CLS
LOCATE 12,5
PRINT "XON 0" + A$ + " XOFF"
PRINT #1, CHR$(17) + "0" +A$ + CHR$(19) 'Send string to the port'
LOOP WHILE NOT (A$="")
*/
*/
*/
*/
/*open COM2 port*/
/*Until press Enter key*/
'Print string on screen'
'Until empty string is entered'

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ldp-144Ldp-146Ldp-126

Table of Contents