There is no compatibility in functions of N88BASIC and new function.
It is necessary to Migrate program by referring to following correspondence tables and examples for conversion.
N88BASIC |
|
New Function |
Setting and Test Functions |
||
END |
||
ISET IFC |
||
SET REN IRESET REN |
|
|
CMD DELIM |
||
CMD TIMEOUT |
||
IEEE(0) IEEE(1) IEEE(2) |
None |
|
Transmitting/Receiving Functions |
||
PRINT@ |
||
WBYTE (multi-line message) |
||
WBYTE (binary data) |
None |
|
INPUT@ |
None |
GpibRecData(Substitution) |
LINE INPUT@ |
||
RBYTE |
None |
|
Serial Poll Functions |
||
POLL |
||
IEEE(4) IEEE(5) IEEE(6) |
None |
Not supported |
Parallel Poll Functions |
||
PPOLL |
None |
Not implemented |
IEEE(7) |
None |
Not implemented |
CMD PPR |
None |
Not implemented |
SRQ Transmitting Functions |
||
ISET SRQ STATUS |
||
Event Functions |
||
ON SRQ GOSUB |
None |
Not implemented |
SRQ ON SRQ OFF SRQ STOP |
None |
Not implemented |
N88BASIC |
Program Contents |
New Function |
100 ISET IFC 300 END |
Declares variable of return value Specifies Device Name Declares variable of Device ID Sets IFCTime Initializes device Transmits IFC Terminates device |
long Ret; char DeviceName[50] = "Gpib000"; short DevId; short IfcTime = 1; Ret = GpibInit ( DeviceName, &DevId ); Ret = GpibSendIFC ( DevId ); Ret = GpibExit ( DevId ); |
N88BASIC |
Program Contents |
New Function |
110 ISET REN |
Sets Enable to enabled Sets REN to enabled |
short Enable = 1; Ret = GpibChangeREN ( DevId, Enable ); |
290 IRESET REN |
Sets Enable to disabled Sets REN to disabled |
short Enable = 0; Ret = GpibChangeREN ( DevId, Enable ); |
N88BASIC |
Program Contents |
New Function |
120 CMD DELIM = 0 |
Declares variable Sets Delim Sets Eoi Sets Eos (fixed 0) Sets delimiter and EOI * Setting value is different |
short Delim, Eoi, Eos; Delim = 1; Eoi = 1; Eos = 0; Ret = GpibSetDelim ( DevId, Delim, Eoi, Eos ); |
N88BASIC |
Program Contents |
New Function |
130 CMD TIMEOUT = 10 |
Declares variable Sets TimeOut Sets value of timeout * Setting value is different |
long TimeOut; TimeOut = 1000; Ret = GpibSetTimeOut ( DevId, TimeOut ); |
N88BASIC |
Program Contents |
New Function |
Master mode |
||
200 PRINT @1; "*IDN?"@ |
Declares variable of number of data Declares variable of array of address Declares variable of data Specifies address of talker Specifies address of listener
Sets address
Sets data Sets number of data Transmits data to specified address
|
long SendLen; short Talker, ListenerArray[15]; char SendBuf[256]; Talker = 0; ListenerArray[0] = 1; ListenerArray[1] = -1; Ret = GpibSetAddrInfo ( DevId, Talker, ListenerArray ); strcpy ( SendBuf, "*IDN?" ); SendLen = strlen ( SendBuf ); Ret = GpibSendData ( DevId, &SendLen, SendBuf ); |
Slave mode |
||
200 PRINT @; "*IDN?"@ |
Declares variable of number of data Declares variable of array of address Declares variable of data Sets address for slave
Sets address
Sets data Sets number of data Transmits data
|
long SendLen; short Talker, ListenerArray[15]; char SendBuf[256]; Talker = -1; ListenerArray[0] = -1; Ret = GpibSetAddrInfo ( DevId, Talker, ListenerArray ); strcpy ( SendBuf, "*IDN?" ); SendLen = strlen ( SendBuf ); Ret = GpibSendData ( DevId, &SendLen, SendBuf ); |
N88BASIC |
Program Contents |
New Function |
190 WBYTE &H5F, &H3F; |
Declares variable of command
Sets UNT Sets UNL
Transmits command |
short CmdArray[255];
CmdArray[0] = 0x5f; CmdArray[1] = 0x3f; CmdArray[2] = -1; Ret = GpibSendCommands ( DevId, CmdArray ); |
N88BASIC |
Program Contents |
New Function |
Master mode |
||
210 LINE INPUT @1;A$
220 PRINT A$ |
Declares variable of number of data Declares variable of array of address Declares variable of data
Specifies address of talker Specifies address of listener
Sets address
Sets maximum number of data to receive Receives data from specified address
If it is normally completed Displays received data |
long RecLen; short Talker, ListenerArray[15]; char RecBuf[256];
Talker = 1; ListenerArray[0] = 0; ListenerArray[1] = -1; Ret = GpibSetAddrInfo ( DevId, Talker, ListenerArray ); RecLen = 256; Ret = GpibRecData ( DevId, &RecLen, RecBuf ); if ( Ret == 0 ) { Printf ( "%s\n", RecBuf ); } |
Slave mode |
||
210 LINE INPUT @;A$
220 PRINT A$ |
Declares variable of number of data Declares variable of array of address Declares variable of data Sets address for slave
Sets address
Sets maximum number of data to receive Receives data from specified address
If it is normally completed Displays received data |
long RecLen; short Talker, ListenerArray[15]; char RecBuf[256]; Talker = -1; ListenerArray[0] = -1; Ret = GpibSetAddrInfo ( DevId, Talker, ListenerArray ); RecLen = 256; Ret = GpibRecData ( DevId, &RecLen, RecBuf ); if ( Ret == 0 ) { Printf ( "%s\n", RecBuf ); } |
N88BASIC |
Program Contents |
New Function |
250 POLL 1,DS1;2,DS2
260 PRINT DS1 270 PRINT DS2 |
Declares variable of address Declares variable of status byte Declares variable of SRQ Sets address to 1 Sets address to 2
Performs serial poll
If it is normally completed Displays Stb of address 1 Displays Stb of address 2
|
short AddrArray[15]; short StbArray[15]; short SrqArray[15]; AddrArray[0] = 1; AddrArray[1] = 2; AddrArray[2] = -1; Ret = GpibSPollAll ( DevId, AddrArray, StbArray, SrqArray ); if ( Ret == 0 ) { Printf ( "%ld\n", StbArray[0] ); Printf ( "%ld\n", StbArray[1] ); } |
N88BASIC |
Program Contents |
New Function |
150 STATUS = &H10 160 ISET SRQ |
Declares variable Sets to transmit SRQ Sets status byte Sets SRQ and Stb
|
short SrqSend, Stb; SrqSend = 1; Stb = 0x10; Ret = GpibSendSRQ ( DevId, SrqSend, Stb ); |