Omron V400-H111 user manual Calculation Programming Example for Sending FCS

Page 87

Appendices FCS Calculation Method

Appendices

Calculation Programming Example for Sending FCS

DATA$

Sample data string

 

 

L

Data length

 

 

CODE$

Data character

 

 

A

Exclusive OR

 

 

100 ’* * * * * CALCULATE FCS * * * * *

110’* FCSSET

120L=LEN(DATA$)

130A=0

140FOR J=1 TO L

150CODE$=MID$(DATA$,J,1)

160A=ASC(CODE$)XOR A

170

NEXT J

180

FCS$=HEX$(A)

190

IF LEN(FCS$)=1 THEN FCS$=“0”+FCS$

200RETURN

FCS Check Subroutine Example for Received Data

1000

’* * * * * FCSHECK * * * * *

 

1010

’* FCSHECK

 

1020

Q=0:FCSCK$=“OK”

 

1030

PRINT RESPONSE $

 

1040

LENGS=LEN(RESPONSE$)-3

 

1050

FCSP$=MID$(RESPONSE$,LENGS+1,2)

’FCS in response data

1060

FOR J=1 TO LENGS

’Calculation range of FCS

1070

Q=ASC(MID$(RESPONSE$,J,1))XOR Q

 

1080

NEXT J

 

1090

FCSD$=HEX$(Q)

 

1100

IF LEN(FCSD$)=1 THEN FCSD$=“0”+FCSD$

’FCS calculated in a program

1110

IF FCSD$ < > FCSP$ THEN FCSCK$=“ERR”

 

1120

PRINT “FCSD$=”;FCSD$;“FCSP$=”;FCSP$;

’FCS received correctly: OK

 

“FCSCK$=”;“FCSCK$=”

’FCS not received correctly:

 

 

ERR

1130

RETURN

 

86

V400-H111/211

User’s Manual

Image 87 Contents
USER’S Manual V400-H111/211 Read and Understand this Document Performance Data Meanings of Signal Words Meanings of Alert SymbolsAlert Statements in this Manual Other Precautions Precautions for Safe UseInstallation Environment Precautions Power Supply and Wiring PrecautionsPrecautions for Correct Use Format How to Use This ManualVisual Aids Contents Startup Reading 2D Code Outputting Results Functions System SettingsSection Product Overview Readable Codes FeaturesZoom Lens Manual Dual System LightingLiquid Crystal Display Data Accumulation Memory Card SlotUseful Functions Data Conversion on DisplayReading 2D Code Installation and Connections p.17System Settings Operation OverviewOperation Overview V400-H111/211 Section Installation and Connections Basic system configuration is shown in the following diagram Basic System ConfigurationComponent Names and Functions Cable Connecting a Personal Computer V400-W21-2M/5M CableConnecting a Personal Computer V400-W22-2M/5M Cable Connecting a Programmable Controller V400-W20-2M/5M Cable Connecting Cables to the Handheld 2D Code Reader Attach the provided ferrite cores to the cableRemove the cover from the Code Reader Connect the cable Cable Disconnecting the Cable from the Handheld 2D Code Reader Cable Connecting the Cable to the Host Device Removing the Cable from the Host DeviceRemove the cable Connection Method Power SupplyConnecting the Power Supply V400-W21-2M/5M, V400-W20-2M/5M Recommended Power SupplyConnect the cable and AC adaptor as shown below Connecting the AC Adaptor V400-W22-2M/5MLoosen the four screws to detach the contactor Mounting ProcedureRemoval Procedure Contactor OptionalClose the Memory Card slot cover Memory CardsInserting the Memory Card Open the Memory Card slot coverPush the Memory Card in gently until a click is heard Removing Memory CardsMemo Section Reading 2D Code Outputting Results Turn on the power and start the Handheld 2D Code ReaderBasic Operation StartupBuzzer StartupZoom Lever Trigger ModeLevel Trigger Factory setting Trigger ButtonsThis area displays images taken by the Camera Outputting ResultsMonitor Description NormalMode a Mode BMode C LED Indicators Output for Unsuccessful ReadingsRead data is output in the following format Sleep FunctionsSection System Settings Uploading Data Using the LCD monitor Creating the Setting FilesOverview Backing Up DataCreating Setting Files Making Settings on the Main Body Basic Operation for Setting ModeNext page, to switch between Making Settings on the Main Body V400-H111/211 Setup window structure Starting Setting Mode Setup ScreenStart setting mode Select SetupChanging Communication Conditions Select Communication in the Setup windowChange the setting Default settings are indicated with an asteriskExit communication setting Save the setting dataExit setting mode Select Function in the Setup window Setting FunctionsExit function setting Uploading from the Memory Card Starting Setting ModeUploading Setting Data to the 2D Code Reader Select Upload Settings in the menu windowSelect the data setting file Uploading from the Memory Card V400-H111/211 Backing Up 2D Code Reader Data Select Backup Settings in the menu windowReturn the settings to the factory settings Restoring the Factory Setting DataClick the OK button Click the button Installing the 2DCR ConfigearClick the OK button Click the Continue buttonCommunication Setting Communicating Using 2DCR ConfigearEdit Setting ReaderMenu FileStatus Display Direct Command InputButtons Display FormOpen Creating Setting Files Using the 2DCR ConfigearSaves the created data setting file ModelVCommunication Settings Level Trigger * or Alternate Function SettingsSection System Settings Setting Method Data Conversion on DisplayCreate the CSV file for the display Conversion function Click 1. New Regist Select the desired start position and number of bytesClick the Import button Select on in Data Conversion on Display field Enter the desired name Click the OK buttonDeleting Items and Changing Item Order Deleting the selected itemsSwapping the order of the selected items Save the settings Exit creation of setting data fileSaving Click the ConnectS button Sending the Setting File to the 2D Code ReaderSelect Setting Reader Send Setting from the menu Exit the 2DCR ConfigearSelect the desired file and click the Open button Memo Section Troubleshooting Section Troubleshooting Appendices Maintenance Handling the Handheld 2D Code ReaderInspection Specifications and Dimensions Handheld 2D Code ReaderV400-H111/211 Appendices Specifications and Dimensions Cable V400-W20-2M/V400-W21-2MV400-W20-5M/V400-W21-5M V400-W22-5M V400-W22-2MV600-A22 ContactorAC adapter V400-AC2Ascii Table Header Footer FCS Calculation MethodFCS Calculation Method Calculation Example for Sending FCSFCS Check Subroutine Example for Received Data Calculation Programming Example for Sending FCSDataMatrix ECC200 Following diagram, the symbol size is 12 ⋅Data Capacity Tables DataMatrixFollowing diagram, the symbol size is 21 ⋅ 21 Version QR CodeQR Code Model Appendices Data Capacity Tables V400-H111/211 Memo Cat. No. Z228-E1-01 Revision HistoryV400-H111/211