12.07.2015 Views

PLCHandler Programming Guide - Esco Drives & Automation

PLCHandler Programming Guide - Esco Drives & Automation

PLCHandler Programming Guide - Esco Drives & Automation

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PLCHandler</strong> <strong>Programming</strong> <strong>Guide</strong>2.7.3 Reading the values of a cyclic listMethods: long ::CycEnterVarAccess(HCYCLIST hCycVarList)long ::CycReadVars(HCYCLIST hCycVarList, PlcVarValue ***pppValues,unsigned long *pulNumOfValues)void ::CycLeaveVarAccess(HCYCLIST hCycVarList)The methods CycEnterVarAccess() and CycLeaveVarAccess() must enclose each read operation in acyclic list to synchronize access to the variables of the list.The method CycReadVars() can be used to access the values of a cyclic list. Those get updatedaccording to the time pattern defined by UpdateRate.Return value : If no error occurs, the function CycEnterVarAccess() return 1. Otherwise, it returns …0: the cyclic list is invalid.Return value: If no error occurs, the function CycReadVars() returns RESULT_OK. Otherwise, it returnsRESULT_FAILED: common error in the underlaying interfaces. A specific error code can beretrieved by GetStatus() resp. GetLastError().RESULT_PLC_NOT_CONNECTED: lost connection to the PLC.RESULT_INVALID_PARAMETER: invalid function parameters (for e.g. NULL).RESULT_PLC_NO_CYCLIC_LIST_DEFINED: invalid list or no list variables to read.2.8 Synchronous reading of variablesMethods:HVARLIST ::SyncReadVarsFromPlc(char **ppszSymbols,unsigned long ulNumOfSymbols, PlcVarValue ***pppValues,unsigned long *pulNumOfValues)long ::SyncReadVarsFromPlcReleaseValues(HVARLIST hSyncRead)The method SyncReadVarsFromPlc() can be used to read the values of a list of variables from thePLC.ppszSymbols: specifies the list of variablesulNumOfSymbols: number of variables in the listpppValues: returns the list of variables values after the callpulNumOfValues: Number of read valuesSyncReadVarsFromPlcReleaseValues() then can be used to deallocate the list of read variablesReturn value: If no error occurs, the function returns a handle for the list. Otherwise, it returns …NULL: function failed. A specific error code can be retrieved by GetStatus() resp.GetLastError().2.9 Synchronous writing of variablesMethod: long ::SyncWriteVarsToPlc(char **ppszSymbols, unsigned long ulNumOfSymbols,unsigned char **ppbyValues)This method can be used to transfer a list of variable values to the PLC.ppszSymbols: specifies the list of variablesulNumOfSymbols: number of variables in the listppbyValues: specifies the variables values which should be written to the PLC. Must match the list ofthe specified variables !Return value: If no error occurs, the function returns RESULT_OK. Otherwise, it returns … 3S - Smart Software Solutions GmbH<strong>PLCHandler</strong> Programmming <strong>Guide</strong>.doc Page 8 of 17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!