background image

 

 

 

 

 

RICOH SC-10 SERIES 

Socket Mode Function Operating Instructions Ver.1.0.0 

5/66 

 

  

 

 

Socket Mode 

Enabling the Socket Mode Control Function 

Set the socket mode control function of the SC-10A in the [Settings] screen of the SC-10A. 
Log in to the SC-10A in the administrator mode and then select [Job Settings...] in the [Job] menu to display the [Settings] 
screen. 

 

 

For details on operation of the SC-10A, refer to the operating instructions of the SC-10 series. 

 
 

 

1. 

Select [Socket Mode]. 

2. 

Select the [Enable Socket Mode] check box.   

3. 

Set the IP address of the other device (other party with which to perform socket mode) 
in [Destination IP Address]. 

4. 

Enter the name of the device in [Device Name]. 

 

Enter any name from 1 to 50 half-width alphanumeric characters long. 

5. 

Click [Save]. 

The settings are saved. 

 

 

 

[Device ID] is set automatically by the system. 

Содержание SC-10 SERIES

Страница 1: ...RICOH SC 10 SERIES Socket Mode Function Operating Instructions Ver 1 0 0 1 66 INSPECTION CAMERA SYSTEM RICOH SC 10 SERIES Socket Mode Function Operating Instructions RICOH Industrial Solutions Inc ...

Страница 2: ...g meanings Indicates an explanation containing points to pay attention to when operating the device restrictions or other information Be sure to read the explanation Indicates an explanation containing information that is useful to know a supplementary operating procedure or other information P Indicates reference information Indicates a screen item or button name ...

Страница 3: ...art processing 10 External IO OUT link 11 Matching of multiple work items of one work ID 12 Stopping work item TCP IP 13 Message crossing stop request 14 Start request timeout 15 Work item completed notification response timeout 15 MESSAGE IDS 16 Socket Mode Message IDs 16 Message Headers 17 Message ID Request Message Other Device SC 10A 18 Message ID Notification Message Response Other Device SC ...

Страница 4: ...licable Devices and Connection Configuration Applicable models The following devices support socket mode Inspection camera system SC 10A Ver 4 0 0 or later Inspection camera system SC 10A H Ver 4 0 0 or later Connection configuration If Ethernet connections are used multiple inspection camera systems can be connected Example 1 Example 2 Ethernet connection Multiple devices can be connected Multipl...

Страница 5: ...enu to display the Settings screen For details on operation of the SC 10A refer to the operating instructions of the SC 10 series 1 Select Socket Mode 2 Select the Enable Socket Mode check box 3 Set the IP address of the other device other party with which to perform socket mode in Destination IP Address 4 Enter the name of the device in Device Name Enter any name from 1 to 50 half width alphanume...

Страница 6: ...vance P 5 1 Select Debug Mode in the socket mode settings screen 2 Click Save When the debug mode is enabled the logs of sent and received messages date and time sent received message ID sent received information and error code are displayed in the log display area If you click Save Log you can save the logs to media If you select a message to send to the other device from the pull down menu and t...

Страница 7: ...uting work ID Work ID completed Executing work item Logout notification response Login notification response Work item list acquisition request Acquisition completed response Work ID execution request Work ID start request Work ID completed notification T O Timeout Work ID completed response Timeout Work item completed response Stop request Work item completed response Stop request Start request I...

Страница 8: ...s the login information in a login notification after receiving the startup notification response The other device sends a login notification response and the sequence ends Startup notification when successful Logout When the logout operation is performed the SC 10A sends a logout notification The other device sends a logout notification response and the sequence ends SC 10A 対向機 起動通知 起動通知応答 ログイン通知...

Страница 9: ...ta notifications for all of the work items is complete the work item list acquisition completed notification is sent The other device sends a work item list acquisition completed response and the sequence ends SC 10A 対向機 状態確認要求 状態確認応答 SC 10A 対向機 作業Itemリスト取得要求 作業Itemリストデータ通知 作業Itemリストデータ通知 作業Itemリスト取得完了通知 作業Itemリストデータ通知 作業Itemリストデータ通知 作業Itemリストデータ通知 作業Itemリスト取得完了応答 作業Itemリスト取得応答 Notifications are s...

Страница 10: ...lem with the response result the other device sends a start request If there is no problem with the start response from the SC 10A the other device waits for a work item completed notification sent from the SC 10A after the work item execution completes When the work item completed notification is received a work item completed response is sent from the other device When all work items of the work...

Страница 11: ...t mode SC 10A 対向機 Start要求 Start応答 作業Item完了通知 マッチング 作業Item完了応答 作業ID開始要求 作業ID開始応答 作業ID完了通知 作業ID完了応答 対向機 外部IO RUN BUSY BUSY OK RUN Other device SC 10A Other device external IO RUN 1 BUSY 1 BUSY 1 OK 1 RUN 1 Work ID start request Work ID start response Start request Start response Work item completed notification matching Work item completed response Work ID completed notification Work ID completed re...

Страница 12: ...t要求 Item1 Start応答 作業Item完了通知 Item1 マッチング 作業Item完了応答 作業ID開始要求 作業ID開始応答 作業ID完了通知 作業ID完了応答 Start要求 Item2 Start応答 作業Item完了通知 Item2 マッチング 作業Item完了応答 All work items registered to the work ID are executed When the work items within the work ID finish a work ID completed notification is sent Other device SC 10A Work ID start request Work ID start response Start request Item 1 Start response Work item comp...

Страница 13: ...ped the work stops when the stop request is sent to the SC 10 SC 10A 対向機 Start要求 Start応答 作業Item完了通知 Stop 作業Item完了応答 作業ID開始要求 作業ID開始応答 作業ID完了通知 作業ID完了応答 Stop応答 Stop要求 Other device SC 10A Work ID start request Work ID start response Start request Start response Stop request Stop response Work item completed notification stop Work item completed response Work ID completed notification Work ID complet...

Страница 14: ...d notification is received before the stop request The work item completed notification that was received first is processed and then the stop request is discarded SC 10A 対向機 Start要求 Start応答 作業Item完了通知 マッチング 作業Item完了応答 作業ID開始要求 作業ID開始応答 作業ID完了通知 作業ID完了応答 Stop要求 The processing ended successfully so the stop request is discarded Other device SC 10A Work ID start request Work ID start response Start ...

Страница 15: ...eout notification is sent internally in the system after the timer set inside the SC 10A expires in order to perform the timeout process Check the network status and take a measure from the other device SC 10A 受信スレッド 対向機 PC Start要求 作業ID開始要求 作業ID開始応答 タイムアウト通知 作業ID完了通知 T O SC 10A 受信スレッド 対向機 PC Start要求 Start応答 作業Item完了通知 マッチング 作業Item完了応答 作業ID開始要求 作業ID開始応答 タイムアウト通知 作業ID完了通知 T O SC 10A received thread ...

Страница 16: ...10000006 External IO input request 0x00000007 External IO input response 0x10000007 Status check request 0x00000008 Status check response 0x10000008 Notifications Startup notification 0x10010001 Startup notification response 0x00010001 Work item completed notification matching 0x10010002 Work item completed notification serial number 0x10010003 Work item completed notification check mode 0x1001000...

Страница 17: ... area of socket mode Use the data in the startup notification sent when the SC 10A starts up for the device ID and device name Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device ...

Страница 18: ...e external IO the state transitions to the ON state The rise and fall times are defined by the user Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name 0x0048 Work ID Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 5...

Страница 19: ... value reserve Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 0x0087 64 byte char Work ID Up to 50 half width alphanumeric characters long 0x0088 0x0107 64 byte char Work instruction list Up to 50 half wid...

Страница 20: ...ng is stopped If the work item completed notification is received before the stop request due to the timing the stop request is discarded on the SC 10A receive task side The stop response is not returned Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4...

Страница 21: ...quest Acquires a list of the work items registered on the SC 10A Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long ...

Страница 22: ...ibute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Set the lower 4 bytes of the MAC address of the SC 10A 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 0x0087 64 byte char Work ID Up to 50 half width alphanumeric characters long 0x0088 0x00c7 64 byte char Work instruction list Up to 50 half ...

Страница 23: ... the external IO Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name 0x0048 Work ID Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Use the lower 4 bytes of the MAC address of the SC 10A 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048...

Страница 24: ...t Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name 0x0048 Work ID 0x0088 reserve EXTIN3 EXTIN2 EXTIN1 Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Use the lower 4 bytes of the MAC address of the SC 10A 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long ...

Страница 25: ...he SC 10A from the other device Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Use the lower 4 bytes of the MAC address of the SC 10A 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long ...

Страница 26: ...ication When failed 1 is returned and a code indicating the cause is added to the error code Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name 0x0048 Result reserve Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 5...

Страница 27: ...on but instead execute the work items of the same work ID again Enable this when you do not want the level of the RUN signal of the external IO to decrease 2 Complete work ID forcibly when stopping the process at a stage before all items within the work ID are completed to execute another work ID in the next operation Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 ...

Страница 28: ... operations is completed upon receiving the work ID completed notification response Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name 0x0048 Result reserve Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half wi...

Страница 29: ...ation The series of operations is completed upon receiving the work item list acquisition completed notification response Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name 0x0048 Result reserve Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 ...

Страница 30: ... and a code indicating the cause is added to the error code Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name 0x0048 Result reserve Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric charact...

Страница 31: ...d and a code indicating the cause is added to the error code Message format Address bit 31 16 15 0 0x0000 Message ID 0x0004 Device ID 0x0008 Device name 0x0048 Result reserve Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric charac...

Страница 32: ... Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x000c 0x0044 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1 to 31 for the ti...

Страница 33: ...ss Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1 to 31 for the time of ...

Страница 34: ...s Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1 to 31 for the time of t...

Страница 35: ...reserve 0x0048 Result Error code Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte ...

Страница 36: ...ess Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Set the lower 4 bytes of the MAC address of the SC 10A 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uc...

Страница 37: ...on 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Set the lower 4 bytes of the MAC address of the SC 10A 0x000c 0x0044 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1 to 31 for the time of the...

Страница 38: ...ibute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Set the lower 4 bytes of the MAC address of the SC 10A 0x000c 0x0044 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1...

Страница 39: ... MAC address of the SC 10A 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1 to 31 for the time of the SC 10A 0x004c 1 byte uchar Hour Set 0 to 23 for the time of the SC 10A 0x004d 1 byte uchar Minute Set 0 to 59 f...

Страница 40: ...Month Day 0x004c Hour Minute Second reserve Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x0...

Страница 41: ...Device name 0x0048 Year Month Day 0x004c Hour Minute Second reserve 0x0050 Work ID 0x0090 Work instruction list 0x00d0 Work item 0x0110 Worker ID 0x01d8 Work number 0x02a0 Work item last result Elapsed time 0x02a4 Base point degree of similarity 0x02ac Base point rotation angle Number of check points 0x02b0 Check point ID_1 Mode matching Judgment result reserve 0x02b4 Rotation angle Matching time ...

Страница 42: ...th alphanumeric characters long 0x00d0 0x00ff 64 byte char Work item Up to 50 half width alphanumeric characters long 0x0100 0x01d7 200 byte char Worker ID Up to 198 half width alphanumeric characters long 0x01d8 0x029f 200 byte char Work number Up to 198 half width alphanumeric characters long 0x02a0 2 byte int16 Work item last result 0 OK 1 Failed 0x02a2 2 byte uint16 Elapsed time seconds Set th...

Страница 43: ...anumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1 to 31 for the time of the SC 10A 0x004c 1 byte uchar Hour Set 0 to 23 for the time of the SC 10A 0x004d 1 byte uchar Minute Set 0 to 59 for the time of the SC 10A 0x004e 1 byte uchar Second Set 0 to 59 for the time of the SC 10...

Страница 44: ...sage ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1 to 31 for the time of the SC 10A 0x004c 1 byte uchar Hour Set 0 to 23 for the time of t...

Страница 45: ...ge unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 12 for the time of the SC 10A 0x004b 1 byte uchar Day Set 1 to 31 for the time of the SC 10A 0x004c 1 byte uchar Hour Set 0 to 23 for the time of the SC 10A 0x0...

Страница 46: ...ve 0x0050 Work ID Address Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set 1 to 12 for the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 31 for the time of the SC 10A 0x004b 1 byte uch...

Страница 47: ...evice ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set 1 to 12 for the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 31 for the time of the SC 10A 0x004b 1 byte uchar Day Set 0 to 23 for the time of the SC 10A 0x004c 1 byte uchar Hour Set 0 to 59 for the time of the SC 10A 0x004d 1 byte uchar Minute...

Страница 48: ...dress Size Attribute Field name Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set 1 to 12 for the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 31 for the time of the SC 10A 0x004b 1 byte uchar Day Set 0 to 23 f...

Страница 49: ... 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set 1 to 12 for the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 31 for the time of the SC 10A 0x004b 1 byte uchar Day Set 0 to 23 for the time of the SC 10A 0x004c 1 byte uch...

Страница 50: ...n 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set 1 to 12 for the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 31 for the time of the SC 10A 0x004b 1 byte uchar Day Set 0 to 23 for the time of the SC 10A 0x004c 1 byte uc...

Страница 51: ...ame Description 0x0000 4 byte uint32 Message ID Message unique ID 0x0004 4 byte uint32 Device ID Equipment unique ID 0x0008 0x0047 64 byte char Device name Up to 50 half width alphanumeric characters long 0x0048 2 byte uint16 Year Set 1 to 12 for the time of the SC 10A 0x004a 1 byte uchar Month Set 1 to 31 for the time of the SC 10A 0x004b 1 byte uchar Day Set 0 to 23 for the time of the SC 10A 0x...

Страница 52: ...work ID start request was received in other than the waiting state Work ID start request A work ID start request and work ID execution request are accepted only after logging in or after work ID completion The request may have been sent during matching or before the work ID completion response 0x0102 A work ID execution request was received in other than the waiting state Work ID execution request...

Страница 53: ... beginning or end 0x0202 Work instruction list name mismatch The specified work instruction list does not exist Start request Work ID execution request 0x0203 Work item name mismatch The specified work item does not exist Start request Work ID execution request 0x0204 Work ID name blank A work ID name has not been specified Start request Work ID execution request Enter the work ID name in the spec...

Страница 54: ... use and is set exclusively Startup notification Check whether or not the same IP address is being used within the network 0x0509 Connection error SocketAddressNot AvailableError The specified address does not belong to a host Startup notification Binding to the IP address of the sender is not possible Check the communication settings of the sender 0x050A Connection error UnsupportedSocket Operati...

Страница 55: ... comment out this ifdef WIN32 pragma comment lib ws2_32 lib include ws2tcpip h endif ifdef WIN32 define HERROR WSAGetLastError define SAFE_SOCK_CLOSE sock if sock INVALID_SOCKET closesocket sock sock INVALID_SOCKET define SOCK_TYPE SOCKET define SET_SOCKADDR_IPV4 addr value InetPton addr sin_family PCSTR value addr sin_addr S_un S_addr addr sin_addr S_un S_addr value endif define MAX_MSGSIZE 1024 ...

Страница 56: ...ormation of server to which will connect memset dest 0 sizeof dest Zero clear SOCK_TYPE s MakeSocket dest destination port Generation of socket Connect to server if connect s struct sockaddr dest sizeof dest printf Could not connect to s n destination printf type something and press Enter n scanf s buffer return 1 else printf Connect to s n destination send s buffer sizeof buffer 0 Send data to se...

Страница 57: ...10 else data DeviceID strtol argv 2 NULL 16 char dname if argc 3 dname SC10a else dname argv 3 sprintf data DeviceName s dname printf 0x 08X 0x 08X s n data messageID data DeviceID data DeviceName int checkdef int argc char str if argc 2 strcmp str 1 h 0 char str1 printf sample exe messageID deviceID devicename IPaddr xxx xxx xxx xx portnum n printf press Enter n scanf s str1 return 1 if argc 4 ch...

Страница 58: ...ocket mode ifdef WIN32 WSADATA data result WSAStartup MAKEWORD 2 0 data endif if result 0 printf d n HERROR printf Socket mode preparation error n printf Press any key n scanf c ret return 1 Generation of socket s MakeServerSocket source port if s 0 printf d n HERROR printf Socket generation error n printf Press any key n scanf c ret return 1 Bind socket to address result bind s struct sockaddr so...

Страница 59: ...ZE 0 if result 0 printf Receive error n printf Press any key n scanf c ret return 1 Display received string for int i 0 i MAX_MSGSIZE i printf 02X buffer i printf Received printf Connection end n SAFE_SOCK_CLOSE s1 End socket ifdef WIN32 WSACleanup endif printf Press any key n scanf c ret return 0 SOCK_TYPE MakeServerSocket struct sockaddr_in dest int port dest sin_port htons port Specify port num...

Страница 60: ...tes BitConverter GetBytes 0x00000005 messageID buf BitConverter GetBytes 0x73b95610 deviceID sendbytes resize sendbytes buf 4 buf Encoding UTF8 GetBytes SC10a devicename sendbytes resize sendbytes buf 64 buf Encoding UTF8 GetBytes Default workID sendbytes resize sendbytes buf 64 buf Encoding UTF8 GetBytes Work_1 work sendbytes resize sendbytes buf 64 buf Encoding UTF8 GetBytes Item_1 item sendbyte...

Страница 61: ...nt get set private Socket get set public SC10TCPcliant IPAddress ip int port this ServerIPEndPoint new IPEndPoint ip port Socket mode connection public void Connect this Socket new Socket AddressFamily InterNetwork SocketType Stream ProtocolType Tcp try this Socket Connect this ServerIPEndPoint catch Exception e Console WriteLine Connection failed n e Send message synchronization process public vo...

Страница 62: ...un using var listenerSocket new Socket AddressFamily InterNetwork SocketType Stream ProtocolType Tcp try Bind socket to address listenerSocket SetSocketOption SocketOptionLevel Socket SocketOptionName ReuseAddress true listenerSocket Bind this IPEndPoint Connection wait start listenerSocket Listen 10 Console WriteLine Server started up nIP address Port number n listenerSocket LocalEndPoint Connect...

Страница 63: ...e clientSocket BeginReceive state Buffer 0 StateObject BufferSize 0 new AsyncCallback ReceiveCallback state private void ReceiveCallback IAsyncResult asyncResult Acquire StateObject and client socket var state asyncResult AsyncState as StateObject var clientSocket state ClientSocket End acquisition of data received from client socket int bytes clientSocket EndReceive asyncResult if bytes 0 Display...

Страница 64: ... Charts Send program Start up Create message data Set IP address and port number Create SC10 TCP client instance Create socket new Socket Send message this Socket Send Sending complete Waiting for input Connect this Socket Connect Connection failed End Was connection successful YES NO ...

Страница 65: ...te socket listenerSocket new Socket Server started up Waiting to receive listenerSocket BeginAccept Bind listenerSocket Bind Start receiving listenerSocket Listen Communication port connection failed End Acquire receive socket asyncResult AsyncState as Socket Display received byte array Wait again clientSocket BeginReceive Message Was receiving successful YES NO ...

Страница 66: ...RICOH SC 10 SERIES Socket Mode Function Operating Instructions Ver 1 0 0 66 66 Revision History Rev Date Changes Note 1 00 2019 01 31 New issue RICOH Industrial Solutions Inc ...

Отзывы: