How to add the instruction for RESTFUL API

Sop

0. Please enable the OCR Table

you can refer the Enable the sharing OCR Table items,if you don’t how to set. Normal machine

1. Add the script

Normal machine

2. Select the MSG_SAVE_TABLE_TO_LOG

Normal machine

Upload all items once

  • Q : 0,Upload all once through RESTFUL(Submachinestatus)
  • X : 0,Save all items > - Text : Bypass the parameter when X is 0 and recode the ROI Table referring to the items of True status

Normal machine

Get the all items by Submachinestatus of RESTFUL API.

  • The items auto upload once based on your design OCR amount when executing this instruciton.

There are 5 ROI case.

Normal machine

There are 9 ROI case

Normal machine

Upload one by one

  • Q : 1,Upload one bye one through RESTFUL
  • X : 1,Save selected items
  • Text : 1~4;7 > - (This case is only allowed those 1 to 4 and 7 of OCR table Set or Get by RESTFUL API.)

Normal machine

You can see the relationship in the below image.

Normal machine

What is one by one

The RESTFUL’s Get function can get one data once for you select OCR table items and without parsing anything metadata.

The RESTFUL’s Set function can set one data to OCR table for handshaking with other app.

1.Set the data to OCR table by anytime.

2.Get the current data from OCR table after executing this command.

3.It wait more time by more you select OCR items.

RESTFUL function list

They support two format both XML and Json. Doc

The port is 5555 for RESTFUL. (Exapmle for local : 127.0.0.1:5555)

1. SubmachineStatuse

  • You can get all the OCR tables that you design for sharing,but mabye you shall analyze it by yourself.

2. Get

  • You can get one metadata from OCR Table that you design for sharing.
  • Those OCR TABLE are update after executing this MSG_SAVE_TABLE_TO_LOG instrution.

The 0 in the OCR table cannot be obtained

3. Set

  • You can set any data to OCR Table.

4. Executescript

  • It can trigg the script that you want to autorun.

5. Stopscript

  • It can stop the current script.

RESTFUL Sample code and Postman applictation

  1. C# sample
  2. Python sample
  3. Postman Application

    3.1 SubmachineStatuse

    Normal machine

    For Command content: http://x.x.x.x:5555/submachinestatus (exchange the ip by yourself)

    For Body content: {“DES”:{“MachineStatus”: {“SubDataType”: “RAW_DATA”}}}

    3.2 Set value

    Normal machine

    For Command content: http://x.x.x.x:5555/setocrdata (exchange the ip by yourself )

    For Body content : OCRID : 22 (OCR Table 22),OCRValue : 7878

    3.3 Get value

    Normal machine

    For Command content: http://x.x.x.x:5555/getocrdata/3 (exchange the ip and 3 ,it is ocr table address, by yourself )

    3.4 Executescript

    Normal machine

    For Command content: http://x.x.x.x:5555/executescript/1 (exchange the ip and 1 ,MSMQ cmd number, by yourself )

    3.5 Stopscript

    Normal machine

    For Command content: http://x.x.x.x:5555/stopscript (exchange the ip by yourself )