|
FOROS PROFESIONALES WINDEV, WEBDEV y WINDEV Mobile |
| | | | | |
Protocole de com PC / Caisse enregistreuse via port serie |
Iniciado por CDAG, 16,abr. 2004 18:39 - 5 respuestas |
| |
| | | |
|
| |
Publicado el 16,abril 2004 - 18:39 |
Bonjour,
Pour une connexion PC / Caisse de magasin via le port serie... J'ai rédigé le code suivant :
//_____________________________________________________ SI sOuvre(2,5000,5000)=Faux ALORS Info("Erreur lors de l'ouverture de la com ") sFerme(2) FIN
// paramétrage du port série gf = sFixeParamètre(2,9600,1,8,0,Vrai,Vrai,Vrai) SI gf =Faux ALORS Erreur("PB dans les paramètres") FIN
t est une chaîne =sLit(2,50) SI t = 0 ALORS Info("PB a la lecture") sFerme(2)
SINON Saisie1 = t Info("Lecture éffectuée")
sFerme(2) FIN
Multitache(-1) //______________________________________________________
Tout semble fonctionner mais la chaine t reste vide. J'en déduit que je dois me positionner une page avant de lire le contenu et c'est là ou je bloque... QQ aurait il une idée pour éclairer ma lanterne ?????????? Ci dessous le protocole de com utilisé
//____________________________________________________
1. Interface Specification
* Hardware Interface : Asychronus RS-232C
* Transmission : Full Duplex
* Baud Rate : 9600 Bit / Sec.
* Data Length : 8 Bits / Character
* Start Bit : 1 Bit
* Stop Bit : 1 Bit
* Parity : Even Parity
Sio 85-98 1st must be set 53 1st digit 1 ; 600, 2 ;1200, 3 ;2400 4 ;4800, 5 ;9600, 6 ;19200 2nd digit 3 ;P.C Mode 2nd must be set 00110111b bit0 ; parity check y/n bit1 ; odd/even bit2-3 ; stop bit 1/1/1.5/2 bit4-5; character 5/6/7/8 ** Signal DTR and RTS of Terminal which is connected with ET-6600 must be "ON".
** Hardware Pin Assignment of PC Interface and Connection
PC side ET-6600 side
Frame Ground Frame Ground (FG) 1 -------------- 11 (FG)
Transmitted Data Transmitted Data (TXD) 2 >>>>>>>>>>>>>> 3 (TXD)
Received Data Received Data (RXD) 3 <<<<<<<<<<<<<< 13 (RXD)
Request To Send Request To Send (RTS) 4 >>>>>>>>>>>>>> 9 (RTS)
Clear To Send Clear To Send (CTS) 5 <<<<<<<<<<<<<< 10 (CTS)
Data Set Ready Data Set Ready (DSR) 6 <<<<<<<<<<<<<< 6 (DSR)
Data Terminal Ready Data Terminal Ready (DTR) 20 >>>>>>>>>>>>>> 2 (DTR)
Signal Ground Signal Ground (SG) 7 -------------- 5 (GND)
2. Transmission Protocol
The Data are "Text Data" and "Control Code Data".
Text Data : start data ... STX end data ... CR & LF
STX ..... CR LF
Control Code Data : ACK, NAK, DC1, DC3, STX, CR, LF ** STX, CR and LF are used as start and end data.
** When "Text Data" is received, Terminal and ET-6600 must transmit "ACK" or "NAK".
Terminal ET-6600
DC1 ----------> . Transmission Requirement <---------- DC1 . Receive Enable Answer TEXT ----------> . Require TEXT DATA <---------- ACK or NAK . ACK/NAK Requirement * DC1 ----------> . Receive Enable <---------- TEXT . Transmit "Text Data" ACK/NAK ----------> . ACK/NAK of Transmitted Data * DC1 ----------> . Receive Enable <---------- TEXT . Transmit "Text Data" ACK/NAK ----------> . ACK/NAK of Transmitted Data * DC1 ----------> . Receive Enable <---------- TEXT . Transmit final "Text Data" with "ETX" code ACK/NAK ----------> . ACK/NAK of final "Text Data"
Note : This time (* mark) is PC (Terminal) processing time of the received data from ET-6600.
The time period between "ACK/NAK" (for receiving of Text from ET-6600) and next "DC1" (for reguiring of next Text) from PC (Terminal) needs minimum 6.0 ms.
3. Configuration of Transmission Data
. Control Code : ACK NAK DC1 DC3
. Text Data : STX ID DATA CR LF
. The code value of each Control Code are showed in page. . ID code identifys the Text Data. . The data length is different, it depends on "ID code". . Data Code is ASCII except "ID code". * Refer to Code Table.
* Text Format
----------------------------- Basic Format : | STX | ID | DATA | CR | LF | |---------------------------- Final Data : | STX | ID | ETX | CR | LF | --------------------------- * only the case of all data request
Requirement of all data transmission of ID code
------------------------------- | STX | ID | ?(3Fh) | CR | LF | -------------------------------
Example 1 : The following format is the requirement of all department programming data.
------------------------------------ | STX | 30h(ID) | 3Fh(?) | CR | LF | ------------------------------------
Example 2 : The following is the requirement of department No.12 programming data.
-------------------------------------------------- | STX | 30h(ID) | 30 30 31 32 | 3Fh(?) | CR | LF | --------------------------------------------------
Example 3 : The following is the requirement of 123 PLU Sales Data.
-------------------------------------------------------- | STX | 43h(ID) | 30 30 30 31 32 33 | 3Fh(?) | CR | LF | --------------------------------------------------------
//______________________________________________________________________________ |
| |
| |
| | | |
|
| | |
| |
Publicado el 16,abril 2004 - 19:57 |
Bonjours, je pense que c'est que tu n'a pas saisi completement le mode de fonctionnement d'un port RS232
sOuvre() // La connection entre le port et la zone "BufferIn" est ouverte sFixeParametre() // La reception peut commencer. Les caractères arrivant sur le port RS232 sont stockés dans un buffer interne "BufferIn" . . . sLit() // extrait les caractères du BufferIn pour les mettres dans ta variable MAIS SEULEMENT SI IL Y EN A !!!!!!
hors dans ton exemple tu lis sans tester le nombre d'octet présent dans BufferIn : sDansFileEntree()
ChaineRecue est une chaine = "" DateHeureDepart est une chaine = datesys()+heuresys() while val(Droite( DateHeureDifference(DateHeureDepart,datesys()+heuresys()), 4))<0400 // 04secondes de timeout if sDansFileEntree(PortCom)>0 then ChaineRecue += sLit(PortCom,sDansFileEntree(PortCom)) DateHeureDepart = datesys()+heuresys() if (condition sur la chaine) = true sortie end end end if ChaineRecue<>"" then ..... else .....
"CDAG" <cdag@chez.com> a écrit dans le message de news:407ff0f1$1@news.pcsoft.fr... > > > Bonjour, > > Pour une connexion PC / Caisse de magasin via le port serie... > J'ai rédigé le code suivant : > > //_____________________________________________________ > SI sOuvre(2,5000,5000)=Faux ALORS > Info("Erreur lors de l'ouverture de la com ") > sFerme(2) > FIN > > // paramétrage du port série > gf = sFixeParamètre(2,9600,1,8,0,Vrai,Vrai,Vrai) > SI gf =Faux ALORS > Erreur("PB dans les paramètres") > FIN > > > t est une chaîne =sLit(2,50) > SI t = 0 ALORS > Info("PB a la lecture") > sFerme(2) > > SINON > Saisie1 = t > Info("Lecture éffectuée") > > sFerme(2) > FIN > > Multitache(-1) > //______________________________________________________ > > Tout semble fonctionner mais la chaine t reste vide. > J'en déduit que je dois me positionner une page avant de lire le contenu > et c'est là ou je bloque... > QQ aurait il une idée pour éclairer ma lanterne ?????????? > Ci dessous le protocole de com utilisé > > //____________________________________________________ > > 1. Interface Specification > > > > * Hardware Interface : Asychronus RS-232C > > * Transmission : Full Duplex > > * Baud Rate : 9600 Bit / Sec. > > * Data Length : 8 Bits / Character > > * Start Bit : 1 Bit > > * Stop Bit : 1 Bit > > * Parity : Even Parity > > Sio 85-98 1st must be set 53 > 1st digit 1 ; 600, 2 ;1200, 3 ;2400 > 4 ;4800, 5 ;9600, 6 ;19200 > 2nd digit 3 ;P.C Mode > 2nd must be set 00110111b > bit0 ; parity check y/n bit1 ; odd/even > bit2-3 ; stop bit 1/1/1.5/2 > bit4-5; character 5/6/7/8 > ** Signal DTR and RTS of Terminal which is connected with > ET-6600 must be "ON". > > > ** Hardware Pin Assignment of PC Interface and Connection > > > PC side ET-6600 side > > Frame Ground Frame Ground > (FG) 1 -------------- 11 (FG) > > Transmitted Data Transmitted Data > (TXD) 2 >>>>>>>>>>>>>> 3 (TXD) > > Received Data Received Data > (RXD) 3 <<<<<<<<<<<<<< 13 (RXD) > > Request To Send Request To Send > (RTS) 4 >>>>>>>>>>>>>> 9 (RTS) > > Clear To Send Clear To Send > (CTS) 5 <<<<<<<<<<<<<< 10 (CTS) > > Data Set Ready Data Set Ready > (DSR) 6 <<<<<<<<<<<<<< 6 (DSR) > > Data Terminal Ready Data Terminal Ready > (DTR) 20 >>>>>>>>>>>>>> 2 (DTR) > > Signal Ground Signal Ground > (SG) 7 -------------- 5 (GND) > > > > 2. Transmission Protocol > > > The Data are "Text Data" and "Control Code Data". > > Text Data : start data ... STX > end data ... CR & LF > > STX ..... CR LF > > Control Code Data : ACK, NAK, DC1, DC3, STX, CR, LF > ** STX, CR and LF are used as start and end data. > > ** When "Text Data" is received, Terminal and ET-6600 > must transmit "ACK" or "NAK". > > > Terminal ET-6600 > > DC1 ----------> . Transmission Requirement > <---------- DC1 . Receive Enable Answer > TEXT ----------> . Require TEXT DATA > <---------- ACK or NAK . ACK/NAK Requirement > * > DC1 ----------> . Receive Enable > <---------- TEXT . Transmit "Text Data" > ACK/NAK ----------> . ACK/NAK of Transmitted Data > * > DC1 ----------> . Receive Enable > <---------- TEXT . Transmit "Text Data" > ACK/NAK ----------> . ACK/NAK of Transmitted Data > * > DC1 ----------> . Receive Enable > <---------- TEXT . Transmit final "Text Data" > with "ETX" code > ACK/NAK ----------> . ACK/NAK of final "Text Data" > > > Note : This time (* mark) is PC (Terminal) processing time > of the received data from ET-6600. > > The time period between "ACK/NAK" (for receiving of > Text from ET-6600) and next "DC1" (for reguiring of > next Text) from PC (Terminal) needs minimum 6.0 ms. > > > > > 3. Configuration of Transmission Data > > > . Control Code : ACK NAK DC1 DC3 > > . Text Data : STX ID DATA CR LF > > > . The code value of each Control Code are showed in page. > . ID code identifys the Text Data. > . The data length is different, it depends on "ID code". > . Data Code is ASCII except "ID code". > * Refer to Code Table. > > > > * Text Format > > ----------------------------- > Basic Format : | STX | ID | DATA | CR | LF | > |---------------------------- > Final Data : | STX | ID | ETX | CR | LF | > --------------------------- > * only the case of all data request > > > Requirement of all data transmission of ID code > > ------------------------------- > | STX | ID | ?(3Fh) | CR | LF | > ------------------------------- > > Example 1 : > The following format is the requirement of all > department programming data. > > ------------------------------------ > | STX | 30h(ID) | 3Fh(?) | CR | LF | > ------------------------------------ > > Example 2 : > The following is the requirement of department No.12 > programming data. > > -------------------------------------------------- > | STX | 30h(ID) | 30 30 31 32 | 3Fh(?) | CR | LF | > -------------------------------------------------- > > Example 3 : > The following is the requirement of 123 PLU Sales > Data. > > -------------------------------------------------------- > | STX | 43h(ID) | 30 30 30 31 32 33 | 3Fh(?) | CR | LF | > -------------------------------------------------------- > > //__________________________________________________________________________ ____ > |
| |
| |
| | | |
|
| | |
| |
Publicado el 17,abril 2004 - 21:54 |
D'abord merci pour ta réponse... Je vais essayer comme ça mais je vois mal où et comment envoyer et recevoir les codes de control ACK, NAK, DC1, DC3, pour me positionner dans le "BufferIn"??? Sans vouloir abusé, peut être as tu une idée ? cordialement CDAG
"Philippe Pasquali" <philippe.pasquali@bopack.com> wrote:
Bonjours, je pense que c'est que tu n'a pas saisi completement le mode
de
fonctionnement d'un port RS232
sOuvre() // La connection entre le port et la zone "BufferIn" est ouverte sFixeParametre() // La reception peut commencer. Les caractères arrivant sur le port RS232 sont stockés dans un buffer interne "BufferIn" . . . sLit() // extrait les caractères du BufferIn pour les mettres dans ta variable MAIS SEULEMENT SI IL Y EN A !!!!!!
hors dans ton exemple tu lis sans tester le nombre d'octet présent dans BufferIn : sDansFileEntree()
ChaineRecue est une chaine = "" DateHeureDepart est une chaine = datesys()+heuresys() while val(Droite( DateHeureDifference(DateHeureDepart,datesys()+heuresys()), 4))<0400 // 04secondes de timeout if sDansFileEntree(PortCom)>0 then ChaineRecue += sLit(PortCom,sDansFileEntree(PortCom)) DateHeureDepart = datesys()+heuresys() if (condition sur la chaine) = true sortie end end end if ChaineRecue<>"" then ..... else .....
"CDAG" <cdag@chez.com> a écrit dans le message de news:407ff0f1$1@news.pcsoft.fr... > > > Bonjour, > > Pour une connexion PC / Caisse de magasin via le port serie... > J'ai rédigé le code suivant : > > //_____________________________________________________ > SI sOuvre(2,5000,5000)=Faux ALORS > Info("Erreur lors de l'ouverture de la com ") > sFerme(2) > FIN > > // paramétrage du port série > gf = sFixeParamètre(2,9600,1,8,0,Vrai,Vrai,Vrai) > SI gf =Faux ALORS > Erreur("PB dans les paramètres") > FIN > > > t est une chaîne =sLit(2,50) > SI t = 0 ALORS > Info("PB a la lecture") > sFerme(2) > > SINON > Saisie1 = t > Info("Lecture éffectuée") > > sFerme(2) > FIN > > Multitache(-1) > //______________________________________________________ > > Tout semble fonctionner mais la chaine t reste vide. > J'en déduit que je dois me positionner une page avant de lire le contenu > et c'est là ou je bloque... > QQ aurait il une idée pour éclairer ma lanterne ?????????? > Ci dessous le protocole de com utilisé > > //____________________________________________________ > > 1. Interface Specification > > > > * Hardware Interface : Asychronus RS-232C > > * Transmission : Full Duplex > > * Baud Rate : 9600 Bit / Sec. > > * Data Length : 8 Bits / Character > > * Start Bit : 1 Bit > > * Stop Bit : 1 Bit > > * Parity : Even Parity > > Sio 85-98 1st must be set 53 > 1st digit 1 ; 600, 2 ;1200, 3 ;2400 > 4 ;4800, 5 ;9600, 6 ;19200 > 2nd digit 3 ;P.C Mode > 2nd must be set 00110111b > bit0 ; parity check y/n bit1 ; odd/even > bit2-3 ; stop bit 1/1/1.5/2 > bit4-5; character 5/6/7/8 > ** Signal DTR and RTS of Terminal which is connected with > ET-6600 must be "ON". > > > ** Hardware Pin Assignment of PC Interface and Connection > > > PC side ET-6600 side > > Frame Ground Frame Ground > (FG) 1 -------------- 11 (FG) > > Transmitted Data Transmitted Data > (TXD) 2 >>>>>>>>>>>>>> 3 (TXD) > > Received Data Received Data > (RXD) 3 <<<<<<<<<<<<<< 13 (RXD) > > Request To Send Request To Send > (RTS) 4 >>>>>>>>>>>>>> 9 (RTS) > > Clear To Send Clear To Send > (CTS) 5 <<<<<<<<<<<<<< 10 (CTS) > > Data Set Ready Data Set Ready > (DSR) 6 <<<<<<<<<<<<<< 6 (DSR) > > Data Terminal Ready Data Terminal Ready > (DTR) 20 >>>>>>>>>>>>>> 2 (DTR) > > Signal Ground Signal Ground > (SG) 7 -------------- 5 (GND) > > > > 2. Transmission Protocol > > > The Data are "Text Data" and "Control Code Data". > > Text Data : start data ... STX > end data ... CR & LF > > STX ..... CR LF > > Control Code Data : ACK, NAK, DC1, DC3, STX, CR, LF > ** STX, CR and LF are used as start and end data. > > ** When "Text Data" is received, Terminal and ET-6600 > must transmit "ACK" or "NAK". > > > Terminal ET-6600 > > DC1 ----------> . Transmission Requirement > <---------- DC1 . Receive Enable Answer > TEXT ----------> . Require TEXT DATA > <---------- ACK or NAK . ACK/NAK Requirement > * > DC1 ----------> . Receive Enable > <---------- TEXT . Transmit "Text Data" > ACK/NAK ----------> . ACK/NAK of Transmitted Data > * > DC1 ----------> . Receive Enable > <---------- TEXT . Transmit "Text Data" > ACK/NAK ----------> . ACK/NAK of Transmitted Data > * > DC1 ----------> . Receive Enable > <---------- TEXT . Transmit final "Text Data" > with "ETX" code > ACK/NAK ----------> . ACK/NAK of final "Text Data" > > > Note : This time (* mark) is PC (Terminal) processing time > of the received data from ET-6600. > > The time period between "ACK/NAK" (for receiving of > Text from ET-6600) and next "DC1" (for reguiring of > next Text) from PC (Terminal) needs minimum 6.0 ms. > > > > > 3. Configuration of Transmission Data > > > . Control Code : ACK NAK DC1 DC3 > > . Text Data : STX ID DATA CR LF > > > . The code value of each Control Code are showed in page. > . ID code identifys the Text Data. > . The data length is different, it depends on "ID code". > . Data Code is ASCII except "ID code". > * Refer to Code Table. > > > > * Text Format > > ----------------------------- > Basic Format : | STX | ID | DATA | CR | LF | > |---------------------------- > Final Data : | STX | ID | ETX | CR | LF | > --------------------------- > * only the case of all data request > > > Requirement of all data transmission of ID code > > ------------------------------- > | STX | ID | ?(3Fh) | CR | LF | > ------------------------------- > > Example 1 : > The following format is the requirement of all > department programming data. > > ------------------------------------ > | STX | 30h(ID) | 3Fh(?) | CR | LF | > ------------------------------------ > > Example 2 : > The following is the requirement of department No.12 > programming data. > > -------------------------------------------------- > | STX | 30h(ID) | 30 30 31 32 | 3Fh(?) | CR | LF | > -------------------------------------------------- > > Example 3 : > The following is the requirement of 123 PLU Sales > Data. > > -------------------------------------------------------- > | STX | 43h(ID) | 30 30 30 31 32 33 | 3Fh(?) | CR | LF | > -------------------------------------------------------- > > //__________________________________________________________________________ ____ >
|
| |
| |
| | | |
|
| | |
| |
Publicado el 26,abril 2004 - 13:37 |
Bonjour,
Pour envoyer : sEcrit( Port, Caract(<valeur Ascii du caractére>) ) par exemple ENQ = 05h : sEcrit( Port, Caract(0x05) )
Pour tester dans une chaine p est un entier = Position(BufferIn, Caract(0x05) ) IF p>0 THEN // ENQ est présent dans la chaine à la position p END
"CDAG" <cdag@chez.com> a écrit dans le message de news:408372dd$1@news.pcsoft.fr... > > > D'abord merci pour ta réponse... > Je vais essayer comme ça mais je vois mal où et comment envoyer et recevoir > les codes de control ACK, NAK, DC1, DC3, pour me positionner dans le "BufferIn"??? > Sans vouloir abusé, peut être as tu une idée ? > cordialement > CDAG > > > "Philippe Pasquali" <philippe.pasquali@bopack.com> wrote: > > > > > > Bonjours, je pense que c'est que tu n'a pas saisi completement le mode > de > >fonctionnement d'un port RS232 > > > > sOuvre() // La connection entre le port et la zone > >"BufferIn" est ouverte > > sFixeParametre() // La reception peut commencer. Les caractères arrivant > >sur le port RS232 sont stockés dans un buffer interne "BufferIn" > > . > > . > > . > > sLit() // extrait les caractères du BufferIn pour les > >mettres dans ta variable MAIS SEULEMENT SI IL Y EN A !!!!!! > > > > hors dans ton exemple tu lis sans tester le nombre d'octet présent dans > >BufferIn : sDansFileEntree() > > > > ChaineRecue est une chaine = "" > > DateHeureDepart est une chaine = datesys()+heuresys() > > while val(Droite( > >DateHeureDifference(DateHeureDepart,datesys()+heuresys()), 4))<0400 > >// 04secondes de timeout > > if sDansFileEntree(PortCom)>0 then > > ChaineRecue += sLit(PortCom,sDansFileEntree(PortCom)) > > DateHeureDepart = datesys()+heuresys() > > if (condition sur la chaine) = true > > sortie > > end > > end > > end > > if ChaineRecue<>"" then > > ..... > > else > > ..... > > > > > > "CDAG" <cdag@chez.com> a écrit dans le message de > >news:407ff0f1$1@news.pcsoft.fr... > > > > > > > > > Bonjour, > > > > > > Pour une connexion PC / Caisse de magasin via le port serie... > > > J'ai rédigé le code suivant : > > > > > > //_____________________________________________________ > > > SI sOuvre(2,5000,5000)=Faux ALORS > > > Info("Erreur lors de l'ouverture de la com ") > > > sFerme(2) > > > FIN > > > > > > // paramétrage du port série > > > gf = sFixeParamètre(2,9600,1,8,0,Vrai,Vrai,Vrai) > > > SI gf =Faux ALORS > > > Erreur("PB dans les paramètres") > > > FIN > > > > > > > > > t est une chaîne =sLit(2,50) > > > SI t = 0 ALORS > > > Info("PB a la lecture") > > > sFerme(2) > > > > > > SINON > > > Saisie1 = t > > > Info("Lecture éffectuée") > > > > > > sFerme(2) > > > FIN > > > > > > Multitache(-1) > > > //______________________________________________________ > > > > > > Tout semble fonctionner mais la chaine t reste vide. > > > J'en déduit que je dois me positionner une page avant de lire le contenu > > > et c'est là ou je bloque... > > > QQ aurait il une idée pour éclairer ma lanterne ?????????? > > > Ci dessous le protocole de com utilisé > > > > > > //____________________________________________________ > > > > > > 1. Interface Specification > > > > > > > > > > > > * Hardware Interface : Asychronus RS-232C > > > > > > * Transmission : Full Duplex > > > > > > * Baud Rate : 9600 Bit / Sec. > > > > > > * Data Length : 8 Bits / Character > > > > > > * Start Bit : 1 Bit > > > > > > * Stop Bit : 1 Bit > > > > > > * Parity : Even Parity > > > > > > Sio 85-98 1st must be set 53 > > > 1st digit 1 ; 600, 2 ;1200, 3 > >;2400 > > > 4 ;4800, 5 ;9600, 6 > >;19200 > > > 2nd digit 3 ;P.C Mode > > > 2nd must be set 00110111b > > > bit0 ; parity check y/n bit1 ; > >odd/even > > > bit2-3 ; stop bit 1/1/1.5/2 > > > bit4-5; character 5/6/7/8 > > > ** Signal DTR and RTS of Terminal which is connected with > > > ET-6600 must be "ON". > > > > > > > > > ** Hardware Pin Assignment of PC Interface and Connection > > > > > > > > > PC side ET-6600 side > > > > > > Frame Ground Frame Ground > > > (FG) 1 -------------- 11 (FG) > > > > > > Transmitted Data Transmitted Data > > > (TXD) 2 >>>>>>>>>>>>>> 3 (TXD) > > > > > > Received Data Received Data > > > (RXD) 3 <<<<<<<<<<<<<< 13 (RXD) > > > > > > Request To Send Request To Send > > > (RTS) 4 >>>>>>>>>>>>>> 9 (RTS) > > > > > > Clear To Send Clear To Send > > > (CTS) 5 <<<<<<<<<<<<<< 10 (CTS) > > > > > > Data Set Ready Data Set Ready > > > (DSR) 6 <<<<<<<<<<<<<< 6 (DSR) > > > > > > Data Terminal Ready Data Terminal Ready > > > (DTR) 20 >>>>>>>>>>>>>> 2 (DTR) > > > > > > Signal Ground Signal Ground > > > (SG) 7 -------------- 5 (GND) > > > > > > > > > > > > 2. Transmission Protocol > > > > > > > > > The Data are "Text Data" and "Control Code Data". > > > > > > Text Data : start data ... STX > > > end data ... CR & LF > > > > > > STX ..... CR LF > > > > > > Control Code Data : ACK, NAK, DC1, DC3, STX, CR, LF > > > ** STX, CR and LF are used as start and end data. > > > > > > ** When "Text Data" is received, Terminal and ET-6600 > > > must transmit "ACK" or "NAK". > > > > > > > > > Terminal ET-6600 > > > > > > DC1 ----------> . Transmission Requirement > > > <---------- DC1 . Receive Enable Answer > > > TEXT ----------> . Require TEXT DATA > > > <---------- ACK or NAK . ACK/NAK Requirement > > > * > > > DC1 ----------> . Receive Enable > > > <---------- TEXT . Transmit "Text Data" > > > ACK/NAK ----------> . ACK/NAK of Transmitted Data > > > * > > > DC1 ----------> . Receive Enable > > > <---------- TEXT . Transmit "Text Data" > > > ACK/NAK ----------> . ACK/NAK of Transmitted Data > > > * > > > DC1 ----------> . Receive Enable > > > <---------- TEXT . Transmit final "Text Data" > > > with "ETX" code > > > ACK/NAK ----------> . ACK/NAK of final "Text Data" > > > > > > > > > Note : This time (* mark) is PC (Terminal) processing time > > > of the received data from ET-6600. > > > > > > The time period between "ACK/NAK" (for receiving of > > > Text from ET-6600) and next "DC1" (for reguiring of > > > next Text) from PC (Terminal) needs minimum 6.0 ms. > > > > > > > > > > > > > > > 3. Configuration of Transmission Data > > > > > > > > > . Control Code : ACK NAK DC1 DC3 > > > > > > . Text Data : STX ID DATA CR LF > > > > > > > > > . The code value of each Control Code are showed in page. > > > . ID code identifys the Text Data. > > > . The data length is different, it depends on "ID code". > > > . Data Code is ASCII except "ID code". > > > * Refer to Code Table. > > > > > > > > > > > > * Text Format > > > > > > ----------------------------- > > > Basic Format : | STX | ID | DATA | CR | LF | > > > |---------------------------- > > > Final Data : | STX | ID | ETX | CR | LF | > > > --------------------------- > > > * only the case of all data request > > > > > > > > > Requirement of all data transmission of ID code > > > > > > ------------------------------- > > > | STX | ID | ?(3Fh) | CR | LF | > > > ------------------------------- > > > > > > Example 1 : > > > The following format is the requirement of all > > > department programming data. > > > > > > ------------------------------------ > > > | STX | 30h(ID) | 3Fh(?) | CR | LF | > > > ------------------------------------ > > > > > > Example 2 : > > > The following is the requirement of department No.12 > > > programming data. > > > > > > -------------------------------------------------- > > > | STX | 30h(ID) | 30 30 31 32 | 3Fh(?) | CR | LF | > > > -------------------------------------------------- > > > > > > Example 3 : > > > The following is the requirement of 123 PLU Sales > > > Data. > > > > > > -------------------------------------------------------- > > > | STX | 43h(ID) | 30 30 30 31 32 33 | 3Fh(?) | CR | LF | > > > -------------------------------------------------------- > > > > > > > >//_________________________________________________________________________ _ > >____ > > > > > > > > |
| |
| |
| | | |
|
| | |
| |
Publicado el 30,abril 2004 - 17:03 |
Bonjour. En fait j'ai rédiger une procédure, l'envoi et la réception du 1er caract de control(DC1) ne me pose plus de pb mais je dois envoyer ensuite une chaine complète et là ça bug, je reçois une chaine vide ou DC1 au lieu de ACK ou NAK : //////////////////////////////////////////////////////// PROCEDURE Nouvelle_Procédure()
//Variables ChaineRecue,ChaineRecue2,chEnv2,chEnv3, chEnv4, chEnv5 sont des chaînes = ""
// Ouverture du port spécifié sOuvre(2, 20000, 20000)
// Initialise les paramètres du port série sFixeParamètre(2,9600,2,8,0,Vrai,Vrai,Faux)
SI ErreurDétectée ALORS Erreur("Impossible d'initialiser le port", ErreurInfo()) FIN
SI sDansFileSortie(2) = 0 ALORS //Si bufferOut vide chEnv est une chaîne = Caract(17) SI sEcrit(2,chEnv)=Taille(chEnv) ALORS //Envoi DC1 = Caract(17) ou Caract(0x11) Trace("ENV:"+chEnv) FIN FIN
//Si DC1 a bien été écrit alors on lit le bufferIn DateHeureDepart est une chaîne = DateSys()+HeureSys() TANTQUE Val(Droite(DateHeureDifférence(DateHeureDepart,DateSys()+HeureSys()), 4))<0600 // 06secondes de timeout SI sDansFileEntrée(2)>0 ALORS ChaineRecue = sLit(2,sDansFileEntrée(2)) DateHeureDepart = DateSys()+HeureSys()
SI ChaineRecue = Caract(17) ALORS //DC1 = Caract(17) ou Caract(0x11) Trace("REC:"+ChaineRecue) //Si reçu DC1 envoi REQUIRE TEXT : | STX | 30h(ID) | 3Fh(?) | CR | LF | chEnv2 = Caract(124)+ Caract(2)+ Caract(124)+ Caract(0x30)+ Caract(124)+ Caract(0x3F)+ Caract(124)+ Caract(13)+ Caract(124)+ Caract(10)+ Caract(124) SI sDansFileSortie(2) = 0 ALORS//Si BufferOut vide SI sEcrit(2,chEnv2)=Taille(chEnv2) ALORS Trace("ENV:"+chEnv2) FIN FIN
//Avec ou sans la boucle la ChaineRecue2 reste vide ???????????????????????????????? //TANTQUE Val(Droite(DateHeureDifférence(DateHeureDepart,DateSys()+HeureSys()), 4))<0600// 06secondes de timeout SI sDansFileEntrée(2)>0 ALORS ChaineRecue2 = sLit(2,sDansFileEntrée(2)) //DateHeureDepart = DateSys()+HeureSys() SI ChaineRecue = Caract(6) ALORS//Si reçu ACK = Caract(6) ou Caract(0x06) Trace("REC:"+ChaineRecue2) SORTIR FIN FIN Trace("REC:"+ChaineRecue2) //fin FIN FIN FIN sFerme(2)//Sans ce sferme la chaineRecue2 = DC1, le bufferIn se remplit indéfiniment avec DC1 ?????????
/////////////////////////////////////////////////////////// D'où vient le PB ? Merci d'avance D'AGOSTINO Christian
"Philippe Pasquali" <philippe.pasquali@bopack.com> wrote:
Bonjour,
Pour envoyer : sEcrit( Port, Caract(<valeur Ascii du caractére>) ) par exemple ENQ = 05h : sEcrit( Port, Caract(0x05) )
Pour tester dans une chaine p est un entier = Position(BufferIn, Caract(0x05) ) IF p>0 THEN // ENQ est présent dans la chaine à la position p END
"CDAG" <cdag@chez.com> a écrit dans le message de news:408372dd$1@news.pcsoft.fr... > > > D'abord merci pour ta réponse... > Je vais essayer comme ça mais je vois mal où et comment envoyer et recevoir > les codes de control ACK, NAK, DC1, DC3, pour me positionner dans le "BufferIn"??? > Sans vouloir abusé, peut être as tu une idée ? > cordialement > CDAG > > > "Philippe Pasquali" <philippe.pasquali@bopack.com> wrote: > > > > > > Bonjours, je pense que c'est que tu n'a pas saisi completement le mode > de > >fonctionnement d'un port RS232 > > > > sOuvre() // La connection entre le port et la zone > >"BufferIn" est ouverte > > sFixeParametre() // La reception peut commencer. Les caractères arrivant > >sur le port RS232 sont stockés dans un buffer interne "BufferIn" > > . > > . > > . > > sLit() // extrait les caractères du BufferIn pour les > >mettres dans ta variable MAIS SEULEMENT SI IL Y EN A !!!!!! > > > > hors dans ton exemple tu lis sans tester le nombre d'octet présent dans > >BufferIn : sDansFileEntree() > > > > ChaineRecue est une chaine = "" > > DateHeureDepart est une chaine = datesys()+heuresys() > > while val(Droite( > >DateHeureDifference(DateHeureDepart,datesys()+heuresys()), 4))<0400 > >// 04secondes de timeout > > if sDansFileEntree(PortCom)>0 then > > ChaineRecue += sLit(PortCom,sDansFileEntree(PortCom)) > > DateHeureDepart = datesys()+heuresys() > > if (condition sur la chaine) = true > > sortie > > end > > end > > end > > if ChaineRecue<>"" then > > ..... > > else > > ..... > > > > > > "CDAG" <cdag@chez.com> a écrit dans le message de > >news:407ff0f1$1@news.pcsoft.fr... > > > > > > > > > Bonjour, > > > > > > Pour une connexion PC / Caisse de magasin via le port serie... > > > J'ai rédigé le code suivant : > > > > > > //_____________________________________________________ > > > SI sOuvre(2,5000,5000)=Faux ALORS > > > Info("Erreur lors de l'ouverture de la com ") > > > sFerme(2) > > > FIN > > > > > > // paramétrage du port série > > > gf = sFixeParamètre(2,9600,1,8,0,Vrai,Vrai,Vrai) > > > SI gf =Faux ALORS > > > Erreur("PB dans les paramètres") > > > FIN > > > > > > > > > t est une chaîne =sLit(2,50) > > > SI t = 0 ALORS > > > Info("PB a la lecture") > > > sFerme(2) > > > > > > SINON > > > Saisie1 = t > > > Info("Lecture éffectuée") > > > > > > sFerme(2) > > > FIN > > > > > > Multitache(-1) > > > //______________________________________________________ > > > > > > Tout semble fonctionner mais la chaine t reste vide. > > > J'en déduit que je dois me positionner une page avant de lire le contenu > > > et c'est là ou je bloque... > > > QQ aurait il une idée pour éclairer ma lanterne ?????????? > > > Ci dessous le protocole de com utilisé > > > > > > //____________________________________________________ > > > > > > 1. Interface Specification > > > > > > > > > > > > * Hardware Interface : Asychronus RS-232C > > > > > > * Transmission : Full Duplex > > > > > > * Baud Rate : 9600 Bit / Sec. > > > > > > * Data Length : 8 Bits / Character > > > > > > * Start Bit : 1 Bit > > > > > > * Stop Bit : 1 Bit > > > > > > * Parity : Even Parity > > > > > > Sio 85-98 1st must be set 53 > > > 1st digit 1 ; 600, 2 ;1200, 3 > >;2400 > > > 4 ;4800, 5 ;9600, 6 > >;19200 > > > 2nd digit 3 ;P.C Mode > > > 2nd must be set 00110111b > > > bit0 ; parity check y/n bit1 ; > >odd/even > > > bit2-3 ; stop bit 1/1/1.5/2 > > > bit4-5; character 5/6/7/8 > > > ** Signal DTR and RTS of Terminal which is connected with > > > ET-6600 must be "ON". > > > > > > > > > ** Hardware Pin Assignment of PC Interface and Connection > > > > > > > > > PC side ET-6600 side > > > > > > Frame Ground Frame Ground > > > (FG) 1 -------------- 11 (FG) > > > > > > Transmitted Data Transmitted Data > > > (TXD) 2 >>>>>>>>>>>>>> 3 (TXD) > > > > > > Received Data Received Data > > > (RXD) 3 <<<<<<<<<<<<<< 13 (RXD) > > > > > > Request To Send Request To Send > > > (RTS) 4 >>>>>>>>>>>>>> 9 (RTS) > > > > > > Clear To Send Clear To Send > > > (CTS) 5 <<<<<<<<<<<<<< 10 (CTS) > > > > > > Data Set Ready Data Set Ready > > > (DSR) 6 <<<<<<<<<<<<<< 6 (DSR) > > > > > > Data Terminal Ready Data Terminal Ready > > > (DTR) 20 >>>>>>>>>>>>>> 2 (DTR) > > > > > > Signal Ground Signal Ground > > > (SG) 7 -------------- 5 (GND) > > > > > > > > > > > > 2. Transmission Protocol > > > > > > > > > The Data are "Text Data" and "Control Code Data". > > > > > > Text Data : start data ... STX > > > end data ... CR & LF > > > > > > STX ..... CR LF > > > > > > Control Code Data : ACK, NAK, DC1, DC3, STX, CR, LF > > > ** STX, CR and LF are used as start and end data. > > > > > > ** When "Text Data" is received, Terminal and ET-6600 > > > must transmit "ACK" or "NAK". > > > > > > > > > Terminal ET-6600 > > > > > > DC1 ----------> . Transmission Requirement > > > <---------- DC1 . Receive Enable Answer > > > TEXT ----------> . Require TEXT DATA > > > <---------- ACK or NAK . ACK/NAK Requirement > > > * > > > DC1 ----------> . Receive Enable > > > <---------- TEXT . Transmit "Text Data" > > > ACK/NAK ----------> . ACK/NAK of Transmitted Data > > > * > > > DC1 ----------> . Receive Enable > > > <---------- TEXT . Transmit "Text Data" > > > ACK/NAK ----------> . ACK/NAK of Transmitted Data > > > * > > > DC1 ----------> . Receive Enable > > > <---------- TEXT . Transmit final "Text Data" > > > with "ETX" code > > > ACK/NAK ----------> . ACK/NAK of final "Text Data" > > > > > > > > > Note : This time (* mark) is PC (Terminal) processing time > > > of the received data from ET-6600. > > > > > > The time period between "ACK/NAK" (for receiving
of > > > > Text from ET-6600) and next "DC1" (for reguiring of
> > > next Text) from PC (Terminal) needs minimum 6.0 ms. > > > > > > > > > > > > > > > 3. Configuration of Transmission Data > > > > > > > > > . Control Code : ACK NAK DC1 DC3 > > > > > > . Text Data : STX ID DATA CR LF > > > > > > > > > . The code value of each Control Code are showed in page. > > > . ID code identifys the Text Data. > > > . The data length is different, it depends on "ID code". > > > . Data Code is ASCII except "ID code". > > > * Refer to Code Table. > > > > > > > > > > > > * Text Format > > > > > > ----------------------------- > > > Basic Format : | STX | ID | DATA | CR | LF | > > > |---------------------------- > > > Final Data : | STX | ID | ETX | CR | LF | > > > --------------------------- > > > * only the case of all data request > > > > > > > > > Requirement of all data transmission of ID code > > > > > > ------------------------------- > > > | STX | ID | ?(3Fh) | CR | LF | > > > ------------------------------- > > > > > > Example 1 : > > > The following format is the requirement of all > > > department programming data. > > > > > > ------------------------------------ > > > | STX | 30h(ID) | 3Fh(?) | CR | LF | > > > ------------------------------------ > > > > > > Example 2 : > > > The following is the requirement of department No.12 > > > programming data. > > > > > > -------------------------------------------------- > > > | STX | 30h(ID) | 30 30 31 32 | 3Fh(?) | CR | LF | > > > -------------------------------------------------- > > > > > > Example 3 : > > > The following is the requirement of 123 PLU Sales > > > Data. > > > > > > -------------------------------------------------------- > > > | STX | 43h(ID) | 30 30 30 31 32 33 | 3Fh(?) | CR | LF > > > -------------------------------------------------------- > > > > > > > //_________________________________________________________________________ _ > >____ > > > > > > > > |
| |
| |
| | | |
|
| | |
| |
Publicado el 03,mayo 2004 - 11:26 |
Ton code semble ok. Utilise "TERMINAL DE WINDOWS" mais avant prépare un fichiers text contenant | STX | 30h(ID) | 3Fh(?) | CR | LF | et regarde si ton système de renvoie quelque chose
"CDAG" <cdag@chez.com> a écrit dans le message de news:40925833$1@news.pcsoft.fr... > > > Bonjour. > En fait j'ai rédiger une procédure, l'envoi et la réception du 1er caract > de control(DC1) ne me pose plus de pb mais je dois envoyer ensuite une chaine > complète et là ça bug, je reçois une chaine vide ou DC1 au lieu de ACK ou > NAK : > //////////////////////////////////////////////////////// > PROCEDURE Nouvelle_Procédure() > > //Variables > ChaineRecue,ChaineRecue2,chEnv2,chEnv3, chEnv4, chEnv5 sont des chaînes = > "" > > // Ouverture du port spécifié > sOuvre(2, 20000, 20000) > > // Initialise les paramètres du port série > sFixeParamètre(2,9600,2,8,0,Vrai,Vrai,Faux) > > SI ErreurDétectée ALORS > Erreur("Impossible d'initialiser le port", ErreurInfo()) > FIN > > SI sDansFileSortie(2) = 0 ALORS //Si bufferOut vide > chEnv est une chaîne = Caract(17) > SI sEcrit(2,chEnv)=Taille(chEnv) ALORS > //Envoi DC1 = Caract(17) ou Caract(0x11) > Trace("ENV:"+chEnv) > FIN > FIN > > //Si DC1 a bien été écrit alors on lit le bufferIn > DateHeureDepart est une chaîne = DateSys()+HeureSys() > TANTQUE Val(Droite(DateHeureDifférence(DateHeureDepart,DateSys()+HeureSys()), > 4))<0600 > // 06secondes de timeout > SI sDansFileEntrée(2)>0 ALORS > ChaineRecue = sLit(2,sDansFileEntrée(2)) > DateHeureDepart = DateSys()+HeureSys() > > SI ChaineRecue = Caract(17) ALORS > //DC1 = Caract(17) ou Caract(0x11) > Trace("REC:"+ChaineRecue) > //Si reçu DC1 envoi REQUIRE TEXT : | STX | 30h(ID) | 3Fh(?) | CR | LF | > chEnv2 = Caract(124)+ Caract(2)+ Caract(124)+ Caract(0x30)+ Caract(124)+ > Caract(0x3F)+ Caract(124)+ Caract(13)+ Caract(124)+ Caract(10)+ Caract(124) > > SI sDansFileSortie(2) = 0 ALORS//Si BufferOut vide > SI sEcrit(2,chEnv2)=Taille(chEnv2) ALORS > Trace("ENV:"+chEnv2) > FIN > FIN > > //Avec ou sans la boucle la ChaineRecue2 reste vide ???????????????????????????????? > //TANTQUE Val(Droite(DateHeureDifférence(DateHeureDepart,DateSys()+HeureSys()), > 4))<0600// 06secondes de timeout > SI sDansFileEntrée(2)>0 ALORS > ChaineRecue2 = sLit(2,sDansFileEntrée(2)) > //DateHeureDepart = DateSys()+HeureSys() > SI ChaineRecue = Caract(6) ALORS//Si reçu ACK = Caract(6) ou Caract(0x06) > Trace("REC:"+ChaineRecue2) > SORTIR > FIN > FIN > Trace("REC:"+ChaineRecue2) > //fin > FIN > FIN > FIN > sFerme(2)//Sans ce sferme la chaineRecue2 = DC1, le bufferIn se remplit indéfiniment > avec DC1 ????????? > > /////////////////////////////////////////////////////////// > D'où vient le PB ? > Merci d'avance > D'AGOSTINO Christian > > "Philippe Pasquali" <philippe.pasquali@bopack.com> wrote: > > > > Bonjour, > > > > Pour envoyer : sEcrit( Port, Caract(<valeur Ascii du caractére>) ) > > par exemple ENQ = 05h : sEcrit( Port, Caract(0x05) ) > > > > Pour tester dans une chaine > > p est un entier = Position(BufferIn, Caract(0x05) ) > > IF p>0 THEN > > // ENQ est présent dans la chaine à la position p > > END > > > > "CDAG" <cdag@chez.com> a écrit dans le message de > >news:408372dd$1@news.pcsoft.fr... > > > > > > > > > D'abord merci pour ta réponse... > > > Je vais essayer comme ça mais je vois mal où et comment envoyer et > >recevoir > > > les codes de control ACK, NAK, DC1, DC3, pour me positionner dans le > >"BufferIn"??? > > > Sans vouloir abusé, peut être as tu une idée ? > > > cordialement > > > CDAG > > > > > > > > > "Philippe Pasquali" <philippe.pasquali@bopack.com> wrote: > > > > > > > > > > > > Bonjours, je pense que c'est que tu n'a pas saisi completement le > >mode > > > de > > > >fonctionnement d'un port RS232 > > > > > > > > sOuvre() // La connection entre le port et la zone > > > >"BufferIn" est ouverte > > > > sFixeParametre() // La reception peut commencer. Les caractères > >arrivant > > > >sur le port RS232 sont stockés dans un buffer interne "BufferIn" > > > > . > > > > . > > > > . > > > > sLit() // extrait les caractères du BufferIn pour > >les > > > >mettres dans ta variable MAIS SEULEMENT SI IL Y EN A !!!!!! > > > > > > > > hors dans ton exemple tu lis sans tester le nombre d'octet présent > >dans > > > >BufferIn : sDansFileEntree() > > > > > > > > ChaineRecue est une chaine = "" > > > > DateHeureDepart est une chaine = datesys()+heuresys() > > > > while val(Droite( > > > >DateHeureDifference(DateHeureDepart,datesys()+heuresys()), 4))<0400 > > > >// 04secondes de timeout > > > > if sDansFileEntree(PortCom)>0 then > > > > ChaineRecue += sLit(PortCom,sDansFileEntree(PortCom)) > > > > DateHeureDepart = datesys()+heuresys() > > > > if (condition sur la chaine) = true > > > > sortie > > > > end > > > > end > > > > end > > > > if ChaineRecue<>"" then > > > > ..... > > > > else > > > > ..... > > > > > > > > > > > > "CDAG" <cdag@chez.com> a écrit dans le message de > > > >news:407ff0f1$1@news.pcsoft.fr... > > > > > > > > > > > > > > > Bonjour, > > > > > > > > > > Pour une connexion PC / Caisse de magasin via le port serie... > > > > > J'ai rédigé le code suivant : > > > > > > > > > > //_____________________________________________________ > > > > > SI sOuvre(2,5000,5000)=Faux ALORS > > > > > Info("Erreur lors de l'ouverture de la com ") > > > > > sFerme(2) > > > > > FIN > > > > > > > > > > // paramétrage du port série > > > > > gf = sFixeParamètre(2,9600,1,8,0,Vrai,Vrai,Vrai) > > > > > SI gf =Faux ALORS > > > > > Erreur("PB dans les paramètres") > > > > > FIN > > > > > > > > > > > > > > > t est une chaîne =sLit(2,50) > > > > > SI t = 0 ALORS > > > > > Info("PB a la lecture") > > > > > sFerme(2) > > > > > > > > > > SINON > > > > > Saisie1 = t > > > > > Info("Lecture éffectuée") > > > > > > > > > > sFerme(2) > > > > > FIN > > > > > > > > > > Multitache(-1) > > > > > //______________________________________________________ > > > > > > > > > > Tout semble fonctionner mais la chaine t reste vide. > > > > > J'en déduit que je dois me positionner une page avant de lire le > >contenu > > > > > et c'est là ou je bloque... > > > > > QQ aurait il une idée pour éclairer ma lanterne ?????????? > > > > > Ci dessous le protocole de com utilisé > > > > > > > > > > //____________________________________________________ > > > > > > > > > > 1. Interface Specification > > > > > > > > > > > > > > > > > > > > * Hardware Interface : Asychronus RS-232C > > > > > > > > > > * Transmission : Full Duplex > > > > > > > > > > * Baud Rate : 9600 Bit / Sec. > > > > > > > > > > * Data Length : 8 Bits / Character > > > > > > > > > > * Start Bit : 1 Bit > > > > > > > > > > * Stop Bit : 1 Bit > > > > > > > > > > * Parity : Even Parity > > > > > > > > > > Sio 85-98 1st must be set 53 > > > > > 1st digit 1 ; 600, 2 ;1200, > >3 > > > >;2400 > > > > > 4 ;4800, 5 ;9600, > >6 > > > >;19200 > > > > > 2nd digit 3 ;P.C Mode > > > > > 2nd must be set 00110111b > > > > > bit0 ; parity check y/n bit1 > >; > > > >odd/even > > > > > bit2-3 ; stop bit 1/1/1.5/2 > > > > > bit4-5; character 5/6/7/8 > > > > > ** Signal DTR and RTS of Terminal which is connected with > > > > > ET-6600 must be "ON". > > > > > > > > > > > > > > > ** Hardware Pin Assignment of PC Interface and Connection > > > > > > > > > > > > > > > PC side ET-6600 side > > > > > > > > > > Frame Ground Frame Ground > > > > > (FG) 1 -------------- 11 (FG) > > > > > > > > > > Transmitted Data Transmitted Data > > > > > (TXD) 2 >>>>>>>>>>>>>> 3 (TXD) > > > > > > > > > > Received Data Received Data > > > > > (RXD) 3 <<<<<<<<<<<<<< 13 (RXD) > > > > > > > > > > Request To Send Request To Send > > > > > (RTS) 4 >>>>>>>>>>>>>> 9 (RTS) > > > > > > > > > > Clear To Send Clear To Send > > > > > (CTS) 5 <<<<<<<<<<<<<< 10 (CTS) > > > > > > > > > > Data Set Ready Data Set Ready > > > > > (DSR) 6 <<<<<<<<<<<<<< 6 (DSR) > > > > > > > > > > Data Terminal Ready Data Terminal Ready > > > > > (DTR) 20 >>>>>>>>>>>>>> 2 (DTR) > > > > > > > > > > Signal Ground Signal Ground > > > > > (SG) 7 -------------- 5 (GND) > > > > > > > > > > > > > > > > > > > > 2. Transmission Protocol > > > > > > > > > > > > > > > The Data are "Text Data" and "Control Code Data". > > > > > > > > > > Text Data : start data ... STX > > > > > end data ... CR & LF > > > > > > > > > > STX ..... CR LF > > > > > > > > > > Control Code Data : ACK, NAK, DC1, DC3, STX, CR, LF > > > > > ** STX, CR and LF are used as start and end data. > > > > > > > > > > ** When "Text Data" is received, Terminal and ET-6600 > > > > > must transmit "ACK" or "NAK". > > > > > > > > > > > > > > > Terminal ET-6600 > > > > > > > > > > DC1 ----------> . Transmission Requirement > > > > > <---------- DC1 . Receive Enable Answer > > > > > TEXT ----------> . Require TEXT DATA > > > > > <---------- ACK or NAK . ACK/NAK Requirement > > > > > * > > > > > DC1 ----------> . Receive Enable > > > > > <---------- TEXT . Transmit "Text Data" > > > > > ACK/NAK ----------> . ACK/NAK of Transmitted Data > > > > > * > > > > > DC1 ----------> . Receive Enable > > > > > <---------- TEXT . Transmit "Text Data" > > > > > ACK/NAK ----------> . ACK/NAK of Transmitted Data > > > > > * > > > > > DC1 ----------> . Receive Enable > > > > > <---------- TEXT . Transmit final "Text Data" > > > > > with "ETX" code > > > > > ACK/NAK ----------> . ACK/NAK of final "Text Data" > > > > > > > > > > > > > > > Note : This time (* mark) is PC (Terminal) processing time > > > > > of the received data from ET-6600. > > > > > > > > > > The time period between "ACK/NAK" (for receiving > of > > > > > Text from ET-6600) and next "DC1" (for reguiring > of > > > > > next Text) from PC (Terminal) needs minimum 6.0 ms. > > > > > > > > > > > > > > > > > > > > > > > > > 3. Configuration of Transmission Data > > > > > > > > > > > > > > > . Control Code : ACK NAK DC1 DC3 > > > > > > > > > > . Text Data : STX ID DATA CR LF > > > > > > > > > > > > > > > . The code value of each Control Code are showed in page. > > > > > . ID code identifys the Text Data. > > > > > . The data length is different, it depends on "ID code". > > > > > . Data Code is ASCII except "ID code". > > > > > * Refer to Code Table. > > > > > > > > > > > > > > > > > > > > * Text Format > > > > > > > > > > ----------------------------- > > > > > Basic Format : | STX | ID | DATA | CR | LF | > > > > > |---------------------------- > > > > > Final Data : | STX | ID | ETX | CR | LF | > > > > > --------------------------- > > > > > * only the case of all data request > > > > > > > > > > > > > > > Requirement of all data transmission of ID code > > > > > > > > > > ------------------------------- > > > > > | STX | ID | ?(3Fh) | CR | LF | > > > > > ------------------------------- > > > > > > > > > > Example 1 : > > > > > The following format is the requirement of all > > > > > department programming data. > > > > > > > > > > ------------------------------------ > > > > > | STX | 30h(ID) | 3Fh(?) | CR | LF | > > > > > ------------------------------------ > > > > > > > > > > Example 2 : > > > > > The following is the requirement of department No.12 > > > > > programming data. > > > > > > > > > > -------------------------------------------------- > > > > > | STX | 30h(ID) | 30 30 31 32 | 3Fh(?) | CR | LF | > > > > > -------------------------------------------------- > > > > > > > > > > Example 3 : > > > > > The following is the requirement of 123 PLU Sales > > > > > Data. > > > > > > > > > -------------------------------------------------------- > > > > > | STX | 43h(ID) | 30 30 30 31 32 33 | 3Fh(?) | CR | LF > | > > > > -------------------------------------------------------- > > > > > > > > > > > > > > >>//________________________________________________________________________ _ > >_ > > > >____ > > > > > > > > > > > > > > > > > > > > > |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|