Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 12 of 18

Starnode PC Data Collection Network Operator's Manual, pages 111 to 120

Pages 111 to 120 of 172

The original document is the PDF (2.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

Filed in the catalog under the Computer Identics 320, Computer Identics 325, Computer Identics 326, RVSI CiMatrix 7500, RVSI CiMatrix 7555A, Sick 7555A, RVSI CiMatrix 7600, RVSI CiMatrix 7655, and 11 more models

Page 111

STATUS% - This parameter is an integer variable. Its value indicates whether or not the function was executed successfully. The variable will either be set to a 1 if successful, or a 0 if NOT successful (generally, problems communicating with the Starnode board). STRING$ - (used in SBRDC, SBRDT, SSEND, SRECV, STBLN) - In the STBLN routine, this parameter is a string constant or variable containing the next line of the download table. In the SBRDC, SBRDT, and SSEND routines, this parameter is a string constant or variable that contains the message to be sent. In the SRECV routine, this parameter is a string variable that will contain the message. It must be pre-defined to contain at least 127 characters, e.g. STRING$ = SPACE$(128). The first LENGTH% characters in the string will be altered to contain the received message. TERMNUM% - (used in SSTAT, SSEND, SRECV) - In the SSTAT and SSEND routines, this parameter is an integer constant or variable that contains the terminal number of the data collection terminal. In the SRECV routine, this parameter is an integer variable that will contain the terminal number of the data collection terminal that sent the message. TYPE% - In the SBRDT and STBLB routines, this parameter is an integer constant or variable containing the type of the terminal to receive the broadcast or download. In the SRECV routine, this parameter is an integer variable that will contain the terminal type of the data collection terminal that sent the message. ROMVER% - This parameter is an integer variable that contains the Starnode PC ROM version, and the download table size after SVER is called.

Interface Routines Syntax models and programming examples are provided for each of the two languages supported, C and BASIC.

Rev B, February 2002

Starnode PC Data Collection Network Operator’s Manual

8-5

8 Using Interface Routines

Introduction

Page 112

Chapter

8

Using Interface Routines

PINIT Partially Initialize the Starnode board Upon completion, the function will have a value of 1 (TRUE) if it completed successfully or 0 through -7 if there was a problem in communicating with the Starnode board. If a value of 0 is returned, try calling SINIT() a second time. Return values -1 through -5 indicate hardware diagnostic failures. Return values -6 or -7 are warning messages. The Starnode board is initialized and in operational state. C Language

SYNTAX PINIT(port); EXAMPLE 1 short port; port = 0x300; stat = PINIT (port); switch (stat) case 1:printf("board on ); break; case -1: case -2: case -3: case -4: case -5: case -6: case -7: printf ("Hardware failure on board%D \n",stat); break; default: printf("Problem with Starnode board \n");

Example 2 if (!PINIT(0x300)) if (!PINIT(0x300)) printf("Problem with Starnode board. \n");

Visual Basic SYNTAX STATUS% = PINIT (PORT%)

8-6

Starnode PC Data Collection Network Operator’s Manual Rev B, February 2002

Page 113

Example Dim STATUS% Dim PORT% PORT% = &H3A0 ' Starnode controller at address 0x3A0 STATUS% = PINIT(PORT%) ' Perform partial initialization Select Case STATUS% Case Is = 0 MsgBox ("Problem with Starnode board.") Case Is = -1 MsgBox ("ROM Checksum error") Case Is = -2 MsgBox ("CPU RAM error") Case Is = -3 MsgBox ("RAM error U19") Case Is = -4 MsgBox ("RAM error U3") Case Is = -5 MsgBox ("RAM error U4") Case Is = -6 MsgBox ("Real Time clock U5 error") Case Is = -7 MsgBox ("Backup Battery error U9") Case Else MsgBox ("Successful Initialization") End Select

Rev B, February 2002

Starnode PC Data Collection Network Operator’s Manual

8-7

8 Using Interface Routines

Introduction

Page 114

Chapter

8

Using Interface Routines

SATTN Send an Attention Signal

C Language The SATTN routine returns a value of 1 (TRUE) if it completes successfully or 0 (FALSE) if there is a problem in communicating with the Starnode board. SYNTAX SATTN(); Example if (!SATTN( )) printf("Problem with Starnode board. \n"); if ( !SBRDC (49, 11, Break time!)) printf ("Problem with Starnode board \n");

Visual Basic SYNTAX STATUS%=SATTN() Example Dim STATUS%) STATUS%=SATTN()

‘send with attention

IF (STATUS% = False) Then MsgBox (“Problem with Starnode board.”) End If

8-8

Starnode PC Data Collection Network Operator’s Manual Rev B, February 2002

Page 115

SBRDC Broadcast Message to All The function will, upon completion, have a value of 1 (TRUE) if successful or 0 (FALSE) if there was a problem communicating with the Starnode board.

C Language SYNTAX SBRDC(command,length, &string[?]); Example 1 char msg[50]; short len; len = sprintf(msg,"BREAK TIME!"); comm = 49; if (!SBRDC(comm,len,msg)) printf("Problem with Starnode board. \n"); Example 2 if (!SBRDC(49, 11, BREAK TIME!)) printf("Problem with Starnode board. \n");

Rev B, February 2002

Starnode PC Data Collection Network Operator’s Manual

8-9

8 Using Interface Routines

Introduction

Page 116

Chapter

8

Using Interface Routines

Visual Basic The value returned by the SBRDC function will be placed in the STATUS% variable. SYNTAX STATUS%=SBRDC(COMMAND%,LENGTH%, STRING_VAR$) Example Dim COMMAND% Dim STRING_VAR$ Dim LENGTH% Dim STATUS% COMMAND% = 49 ' Prompt command STRING_VAR$ = "BREAK TIME" LENGTH% = 10 ' 10 character message STATUS% = SBRDC(COMMAND%, LENGTH%, STRING_VAR$) If (STATUS% = False) Then MsgBox ("Problem with Starnode board.") End If

8-10

Starnode PC Data Collection Network Operator’s Manual Rev B, February 2002

Page 117

SBRDT Broadcast Message to Type Upon completion, the function will have a value of 1 (TRUE) if it completed successfully or 0 (FALSE) if there was a problem in communicating with the Starnode board.

C Language SYNTAX SBRDT(termtype,command,length, & string[?]); Example 1 char msg[50]; short len; len = sprintf(msg,"BREAK TIME!"); comm = 49; if (!SBRDT(122,comm,len,msg)) printf("Problem with Starnode board. \n"); Example 2 if (!SBRDT(122,49, 11, BREAK TIME!)) printf("Problem with Starnode board. \n");

Rev B, February 2002

Starnode PC Data Collection Network Operator’s Manual

8-11

8 Using Interface Routines

Introduction

Page 118

Chapter

8

Using Interface Routines

Visual Basic Upon completion, this routine places a value of 1 or 0 into the STATUS% variable. SYNTAX STATUS% = SBRDT (TYPE_NUM%, COMMAND%, LENGTH%, STRING_VAR$) Example Dim COMMAND% Dim STRING_VAR$ Dim LENGTH% Dim STATUS% Dim TYPE_NUM% COMMAND% = 49 ' Prompt command STRING_VAR$ = "BREAK TIME" LENGTH% = 10 ' 10 character message TYPE_NUM% = 1' Send to type 1 STATUS% = SBRDT (TYPE_NUM%, COMMAND%, LENGTH%, STRING_VAR$) If (STATUS% = False) Then MsgBox ("Problem with Starnode board.") End If

8-12

Starnode PC Data Collection Network Operator’s Manual Rev B, February 2002

Page 119

SDLAY Set Delay After I/O Upon completion, the function will have a value of 1 (TRUE).

C Language SYNTAX SDLAY(delay); Example

SDLAY(2);

Visual Basic SYNTAX STATUS% = SDLAY(DELAY%) Example

Dim STATUS% Dim DELAY% DELAY% = 2 STATUS% = SDLAY(DELAY%)

Rev B, February 2002

Starnode PC Data Collection Network Operator’s Manual

8 Using Interface Routines

Introduction

8-13

Page 120

Chapter

8

Using Interface Routines

SGETMEM Get Memory Configuration This routine returns the status of prior SSETMEM attempts and the number of message buffers or priority buffers. Refer to “SSETMEM” on page 8-27 for more information. sgetmem() returns: •

Config[0] = status of prior ssetmem attempt (if any); 0 = no error

•

Config[1] = #of 512 byte buffers for normal input messages; 1-63

•

Config[2] = #of 512 byte priority buffers; 1-63 (total input+priority=64)

•

Config[3] = #of 16K download buffers taken for receive messages

C Language Syntax sgetmem(ucConfig); Example unsigned char ucConfig[4]; if(!sgetmem(ucConfig)) { printf("Problem with STARNODE network"); } else { if(ucConfig[0]) { printf("Last memory configuration attempt failed\n"); } else { printf("Last memory configuration attempt succeeded\n"); } printf("Current input buffer setting is: %d\n", (short)ucConfig[1]); printf("Current priority buffer setting is:%d\n", (short)ucConfig[2]); printf("Current program buffer setting is:%d\n", (short)ucConfig[3]); }

8-14

Starnode PC Data Collection Network Operator’s Manual Rev B, February 2002