Staubli Robotics

Library GRIPLINK Documentation
Description and requirements
The GRIPLINK plug-in connects WEISS ROBOTICS GRIPLINK technology to STÄUBLI robot systems. It provides VAL3 programs to communicate with GRIPLINK Controllers. Originally introduced with the GRIPLINK controller, the protocol has since evolved into a common communication layer across multiple WEISS ROBOTICS products, including the WPG series servo grippers, the INTRAPAL palletizing gripper, and future GRIPLINK-enabled devices.
Basic program flow
1.CONNECT to the GRIPLINK controller. Call once at program start.
2.Optional: Reference devices that require it (e.g., servo grippers without absolute encoders) using HOME. Devices with absolute encoders do not need referencing.
3.Activate devices using ENABLE.
4.Execute device functions, e.g., gripping or releasing for gripper modules (GRIP, RELEASE), or query device states and values.
5.DISCONNECT when the interface must be physically separated (e.g. tool change) or when the program ends.
Hardware required CS9
Required options Stäubli SRS
VAL3 options VAL3 version: 8
Library version 4.0.0.0
Included libraries none
Network The GRIPLINK controller IP address must be on the same subnet as the robot controller. See the GRIPLINK controller manual for the IP change procedure.

Error handling

A TCP/IP connection loss or timeout results in a VAL3 runtime error. On any non-zero value returned in x_nErrorCode, the plug-in resolves it into a human-readable message, shows a popup, and creates a log entry. Application-level recovery (stop motion, move to safe pose) is the integrator's responsibility. As an example, see the errorHandling template in GRIPLINK_Examples as a starting point. Every public sub-program passes by reference a numeric error code (x_nErrorCode):

Blocking mode with DOBLOCK

Use the DOBLOCK parameter to control whether a command blocks until completion or returns immediately:

Note on emergency stop

An emergency stop interrupts robot motion but does not terminate the TCP/IP connection to the GRIPLINK controller. The GRIPLINK plug-in intentionally does not handle emergency stop events. The appropriate response depends on the application — e.g. whether the gripper should be deactivated or remain active to safely retain the workpiece. Safety handling must therefore be implemented separately in the user program. The programmer can query the emergency stop by using the VAL3 function esStatus() (See the VAL3 reference manual) in the user program and respond accordingly based on the application requirements.

Changelog

Version Change Details
4.0.0 Floating-point parameters Scaled integer parameters replaced by floating-point parameters. Affects SETGRIPCFG, VALUE, SETVAL, WAITVAL. Values are now in physical units (e.g. mm instead of mm × 1000). Example: POSITION = 19500 becomes POSITION = 19.5.
4.0.0 GRIP / RELEASE signature change Parameter x_bWstrEnabled (bool) replaced by x_nDoBlock (num). v3: grip(port, preset, devstate&, bWstrEnabled:bool). v4: grip(port, preset, nDoBlock:num, errorCode&).
4.0.0 WAITVAL extended New parameters for precise value monitoring: threshold, tolerance window, and timeout. v3: waitval(port, index, value). v4: waitval(port, index, threshold, windowsize, timeout).
4.0.0 CLAMP parameter type Parameter x_bEnable (bool) replaced by x_nEnable (num). Use 1/0 instead of true/false. v3: clamp(port, bEnable:bool). v4: clamp(port, nEnable:num).
4.0.0 New commands: FLEXGRIP, FLEXRELEASE FLEXGRIP: gripping with freely selectable motion parameters (position, force, speed, acceleration). FLEXRELEASE: release with freely selectable motion parameters (position, speed, acceleration).
4.0.0 Deprecated commands MGRIP, MRELEASE, MWAITFOR retained for backward compatibility. For new projects, use GRIP/RELEASE with DOBLOCK = 0 and WSTR.
Important: Version 4.0.0 is not fully backward-compatible. Existing applications must be reviewed and adapted (scaling factors, GRIP/RELEASE signature, WAITVAL signature, CLAMP parameter type). A complete functional test after migration is recommended.


Description of functions public clamp(...) public connect(...) public devassert(...) public deviceState(...) public disable(...) public disconnect(...) public enable(...) public flexgrip(...) public flexrelease(...) public grip(...) public home(...) public led(...) public mgrip(...) public mrelease(...) public mwaitfor(...) public release(...) public setgripcfg(...) public setvalue(...) public value(...) public waitval(...) public wstr(...) public clamp(num x_nPort, num x_nEnable, num& x_nErrorCode)
Description of program Control the force retention feature. Signature call griplink:clamp(x_nPort, x_nEnable, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nEnable num Grip force retention: 1 = enabled, 0 = disabled
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Examples
DescriptionCode
Enable grip force retention for the device on port 2 call griplink:clamp(2, 1, x_nErrorCode)
Notes The CLAMP command is not available on all gripping modules. History
DateAuthorDescription
02-05-26 H. Efkere Modification. Changed parameter x_bEnable (bool) to x_nEnable (num). On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public connect(sio& x_sioSocket, num& x_nErrorCode)
Description of program Establishes a connection to the GRIPLINK controller before calling any other function. Signature call griplink:connect(x_sioSocket, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_sioSocket sio& (by reference) Open serial I/O socket to the GRIPLINK controller. The function binds the internal sioSocket alias to this variable; all subsequent calls communicate through it.
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure (unexpected response); 0 on success; GRIPLINK controller error codes 1-27 (see readme)
Notes Error handling: see readme for details. Avoid calling this command in a loop, as closing and opening a connection is resource-intensive on the robot controller. Examples
DescriptionCode
Open the connection to the GRIPLINK controller call griplink:connect(sioGriplink, x_nErrorCode)
History
DateAuthorDescription
07-05-26 H. Efkere Modification. Clears socket buffer before opening connection. Verifies that the GRIPLINK controller supports the required protocol version (3). On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public devassert(num x_nPort, num x_nVid, num x_nPid, num& x_nErrorCode)
Description of program Assert type of connected device. Signature call griplink:devassert(x_nPort, x_nVid, x_nPid, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nVid num Vendor ID specified in the IODD of the expected device
x_nPid num Product ID specified in the IODD of the expected device
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes The Vendor IDs and Product IDs are documented in the device description provided by the manufacturer or in the IODD. Error handling: see readme for details. Examples
DescriptionCode
Ensure that the STERIGRIP 200-030 device from Weiss Robotics (VID 815, PID 52) is connected to port x_nPortGripper call griplink:devassert(x_nPortGripper, 815, 52, x_nErrorCode)
History
DateAuthorDescription
12-05-26 H. Efkere Modification. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public deviceState(num x_nPort, num& x_nDeviceState, num& x_nErrorCode)
Description of program Get device state. Signature call griplink:deviceState(x_nPort, x_nDeviceState, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
Output parameters
ArgumentTypeDescription
x_nDeviceState num& (by reference) Current device status.
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes Error handling: see readme for details. Examples
DescriptionCode
Read the current device state for the gripper on port x_nPortGripper call griplink:deviceState(x_nPortGripper, x_nDeviceState, x_nErrorCode)
History
DateAuthorDescription
18-05-26 H. Efkere Modification. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public disable(num x_nPort, num& x_nDeviceState, bool x_bWstrEnabled, num& x_nErrorCode)
Description of program Disable device port. If x_bWstrEnabled is true, blocks until the device reaches a stable state by calling wstr() internally and returning the resulting device state. Signature call griplink:disable(x_nPort, x_nDeviceState, x_bWstrEnabled, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_bWstrEnabled bool If true, waits for state transition after disabling (calls wstr internally).
Output parameters
ArgumentTypeDescription
x_nDeviceState num& (by reference) Device state after the transition (from wstr)
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes Behavior may vary depending on the connected device. Please refer to the instructions in the respective device driver manual! Error handling: see readme for details. Examples
DescriptionCode
Disable with waiting for state transition. call griplink:disable(x_nPortGripper, x_nDeviceState, true, x_nErrorCode)
Disable without waiting for state transition. call griplink:disable(x_nPortGripper, x_nDeviceState, false, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public disconnect()
Description of program Close the TCP/IP socket to the GRIPLINK controller. Signature call griplink:disconnect() Input parameters None Output parameters None Notes Closes the socket connection. Call wherever the connection needs to be closed (e.g. tool change). Examples
DescriptionCode
Close the connection to the GRIPLINK controller call griplink:disconnect()
History
DateAuthorDescription
08-05-26 H. Efkere Creation. Closes the TCP session on the VAL3 side via clearBuffer(sioSocket). Logs a warning if the connection was already closed.
Back to top public enable(num x_nPort, num& x_nDeviceState, bool x_bWstrEnabled, num& x_nErrorCode)
Description of program Enable device port. If x_bWstrEnabled is true, blocks until the device reaches a stable state by calling wstr() internally and returning the resulting device state. Signature call griplink:enable(x_nPort, x_nDeviceState, x_bWstrEnabled, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_bWstrEnabled bool If true, waits for state transition after enabling (calls wstr internally).
Output parameters
ArgumentTypeDescription
x_nDeviceState num& (by reference) Device state after the transition (from wstr).
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes Behavior may vary depending on the connected device. Please refer to the instructions in the respective device driver manual! Error handling: see readme for details. Examples
DescriptionCode
Enable with waiting for state transition. call griplink:enable(x_nPortGripper, x_nDeviceState, true, x_nErrorCode)
Enable without waiting for state transition. call griplink:enable(x_nPortGripper, x_nDeviceState, false, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public flexgrip(num x_nPort, num x_nPosition, num x_nForce, num x_nSpeed, num x_nAcceleration, num x_nDoBlock, num& x_nErrorCode)
Description of program Flexible gripping using motion parameters. Signature call griplink:flexgrip(x_nPort, x_nPosition, x_nForce, x_nSpeed, x_nAcceleration, x_nDoBlock, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 – 31).
x_nPosition num Target position representing the No Part Limit in mm.
x_nForce num Gripping force in N.
x_nSpeed num Gripping speed in mm/s (Set to 0 for using the auto-computed speed value based on the selected gripping force).
x_nAcceleration num Finger acceleration in mm/s² (Set to 0 for using the default acceleration value).
x_nDoBlock num 0 = Return immediately after motion was initiated, 1 = Block, until the grip motion was finished.
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes This command is not available for all devices. Error handling: see readme for details. Examples
DescriptionCode
Grip with 60 N, no-part-limit = 15 mm, speed = 45.5 mm/s, using the default acceleration value, non-blocking call griplink:flexgrip(x_nPortGripper, 15, 60, 45.5, 0, 0, x_nErrorCode)
Same parameters, blocking (x_nDoBlock = 1). call griplink:flexgrip(x_nPortGripper, 15, 60, 45.5, 0, 1, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Creation. Added FLEXGRIP command for flexible gripping using motion parameters. Floating-point parameters are supported. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public flexrelease(num x_nPort, num x_nPosition, num x_nSpeed, num x_nAcceleration, num x_nDoBlock, num& x_nErrorCode)
Description of program Flexible releasing using motion parameters. Signature call griplink:flexrelease(x_nPort, x_nPosition, x_nSpeed, x_nAcceleration, x_nDoBlock, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 – 31)
x_nPosition num Target position representing the Release Limit in mm.
x_nSpeed num Release speed in mm/s (Set to 0 for using the default release speed value).
x_nAcceleration num Release acceleration in mm/s² (Set to 0 for using the default acceleration value).
x_nDoBlock num 0 = Return immediately after motion was initiated, 1 = Block, until the release motion was finished.
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes This command is not available for all devices. Error handling: see readme for details. Examples
DescriptionCode
Pre-position the gripper on port x_nPortGripper to 19.5 mm using default speed and acceleration, non-blocking call griplink:flexrelease(x_nPortGripper, 19.5, 0, 0, 0, x_nErrorCode)
Same parameters, blocking (x_nDoBlock = 1) call griplink:flexrelease(x_nPortGripper, 19.5, 0, 0, 1, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Creation. Added FLEXRELEASE command for parametric release without a stored preset. Typical use is asynchronous pre-positioning of the fingers while the robot is still travelling to the pick pose. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public grip(num x_nPort, num x_nPreset, num x_nDoBlock, num& x_nErrorCode)
Description of program Grip with the selected grip preset. Signature call griplink:grip(x_nPort, x_nPreset, x_nDoBlock, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nPreset num Grip index. The number of available recipes/presets depends on the connected device.
x_nDoBlock num Blocking mode. 1: Block, until either workpiece was gripped or not found. 0: Return immediately after motion was initiated
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes Error handling: see readme for details. Examples
DescriptionCode
Grip on port x_nPortGripper using preset 0, blocking; call griplink:grip(x_nPortGripper, 0, 1, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. Parameter x_bWstrEnabled (bool) replaced by x_nDoBlock (num). On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public home(num x_nPort, num& x_nErrorCode)
Description of program Perform a homing sequence. Signature call griplink:home(x_nPort, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes The function will block until the homing sequence is completed. Error handling: see readme for details. Examples
DescriptionCode
Perform a homing sequence for the gripper on port x_nPortGripper call griplink:home(x_nPortGripper, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. Device state is no longer queried automatically after homing; call griplink:deviceState() explicitly if the state is needed. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public led(num x_nPort, num x_nPreset, num& x_nErrorCode)
Description of program Set LED visualization. Signature call griplink:led(x_nPort, x_nPreset, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nPreset num LED preset index
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes This command is not available for all devices. Error handling: see readme for details. Examples
DescriptionCode
Set LED visualization preset 1 for the device on port 2 call griplink:led(2, 1, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public mgrip(num x_nPreset, num x_nPorts, bool x_bMwaitforEnabled, num& x_nErrorCode)
Description of program This command is deprecated. Grip with selected devices. Signature call griplink:mgrip(x_nPreset, x_nPorts, x_bMwaitforEnabled, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPreset num Grip preset index
x_nPorts num Port bitmask encoding the selected devices (bit 0 = port 0, bit 1 = port 1)
x_bMwaitforEnabled bool If true, calls MWAITFOR to wait for completion
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure (unexpected response); 0 on success; GRIPLINK controller error codes 1-27 (see readme)
Notes Error handling: see readme for details. Examples
DescriptionCode
Grip preset 0 on ports 0, 1, 2, 3
x_nPorts = 15 (0b1111 → MGRIP(0,1,1,1,1))
x_nPorts = 15
call griplink:mgrip(0, x_nPorts, true, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public mrelease(num x_nPreset, num x_nPorts, bool x_bMwaitforEnabled, num& x_nErrorCode)
Description of program This command is deprecated. Release with selected devices. Signature call griplink:mrelease(x_nPreset, x_nPorts, x_bMwaitforEnabled, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPreset num Release preset index
x_nPorts num Port bitmask encoding the selected devices (bit 0 = port 0, bit 1 = port 1)
x_bMwaitforEnabled bool If true, calls MWAITFOR to wait for completion
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure (unexpected response); 0 on success; GRIPLINK controller error codes 1-27 (see readme)
Notes Error handling: see readme for details. Examples
DescriptionCode
Release preset 0 on ports 0, 1, 2, 3
x_nPorts = 15 (0b1111 → MRELEASE(0,1,1,1,1))
x_nPorts = 15
call griplink:mrelease(0, x_nPorts, true, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public mwaitfor(num x_nPorts, num& x_nErrorCode)
Description of program This command is deprecated. Wait for state transition on multiple devices. Signature call griplink:mwaitfor(x_nPorts, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPorts num (by value) Bitmask encoding the selected device ports
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure (unexpected response); 0 on success; GRIPLINK controller error codes 1-27 (see readme)
Notes Error handling: see readme for details. Examples
DescriptionCode
Wait for completion on ports 0, 1, 2, 3
x_nPorts = 15 (0b1111 → MWAITFOR(1,1,1,1))
x_nPorts = 15
call griplink:mwaitfor(x_nPorts, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public release(num x_nPort, num x_nPreset, num x_nDoBlock, num& x_nErrorCode)
Description of program Release with the selected grip preset. Signature call griplink:release(x_nPort, x_nPreset, x_nDoBlock, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nPreset num Grip index. The number of available recipes/presets depends on the connected device.
x_nDoBlock num Blocking mode. 1: Block, until the release motion was finished. 0: Return immediately after motion was initiated (default).
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes Error handling: see readme for details. Examples
DescriptionCode
Release the workpiece previously gripped by the gripper on port x_nPortGripper using preset 0, blocking call griplink:release(x_nPortGripper, 0, 1, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. Parameter x_bWstrEnabled (bool) replaced by x_nDoBlock (num). On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public setgripcfg(num x_nPort, num x_nPreset, string x_sTag, num& x_nParams[---], num& x_nErrorCode)
Description of program Set grip configuration Signature call griplink:setgripcfg(x_nPort, x_nPreset, x_sTag, x_nParams, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nPreset num Grip preset index
x_sTag string Preset tag name string
x_nParams numArray For WEISS ROBOTICS gripper modules: [No-Part limit (mm), Release limit (mm), Force factor (%)]
For WEISS ROBOTICS WPG series (params 0 to 7): [No-Part limit (mm), Release limit (mm), Force factor (%), Grip speed (mm/s), Grip acceleration (mm/s2), Release speed (mm/s), Release acceleration (mm/s2), Reserved]
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure (unexpected response); 0 on success; GRIPLINK controller error codes 1-27 (see readme)
Notes Error handling: see readme for details. Examples
DescriptionCode
No-Part limit 42.5 mm
Release limit 60.5 mm
Force factor 70 %
x_nParams[0] = 42.5
x_nParams[1] = 60.5
x_nParams[2] = 70
call griplink:setgripcfg(x_nPortGripper, 0, "Test1", x_nParams, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. Added floating point support. Scaled integer values are replaced with floating point values. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public setvalue(num x_nPort, num x_nValueIndex, num x_nValue, num& x_nErrorCode)
Description of program This function can be used to set a device value. Signature call griplink:setvalue(x_nPort, x_nValueIndex, x_nValue, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nValueIndex num Value index. The number of provided values depends on the connected device.
x_nValue num Value to set.
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Caution Risk of injury The SETVAL command may lead to sudden movement on actuators! Notes The behavior strongly depends on the connected device type and the value index. Error handling: see readme for details. Examples
DescriptionCode
Set value index 0 to 15.5 on the device at port x_nPortGripper. call griplink:setvalue(x_nPortGripper, 0, 15.5, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. Scaled integer parameters replaced by floating-point parameters. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public value(num x_nPort, num x_nValueIndex, num& x_nValue, num& x_nErrorCode)
Description of program Read a sensor value from the given device. Signature call griplink:value(x_nPort, x_nValueIndex, x_nValue, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nValueIndex num Value index. The number of provided values depends on the connected device.
Output parameters
ArgumentTypeDescription
x_nValue num& (by reference) Returned value
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes If the sensor value is out of range, depending on the direction of overflow, the VALUE function returns 2.147.483.647 (INT32 MAX) or -2.147.483.648 (INT32 MIN) Error handling: see readme for details. Examples
DescriptionCode
Retrieve the finger position (value index 0) of the connected gripper on port x_nPortGripper call griplink:value(x_nPortGripper, 0, x_nValue, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. Scaled integer parameters replaced by floating-point parameters. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public waitval(num x_nPort, num x_nIndex, num x_nThreshold, num x_nWindowsize, num x_nTimeout, num& x_nErrorCode)
Description of program This function can be used to wait until the desired value has reached or crosses a threshold window. Signature call griplink:waitval(x_nPort, x_nIndex, x_nThreshold, x_nWindowsize, x_nTimeout, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num Port index (0 to 31).
x_nIndex num Value index (0..n-1). The number of provided values depends on the connected device.
x_nThreshold num Target value threshold to wait for (mm).
x_nWindowsize num Size of the window around the threshold value to check for (mm).
x_nTimeout num Timeout (ms).
Output parameters
ArgumentTypeDescription
x_nErrorCode num& (by reference). -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes The command returns a timeout error (ERR 05) via x_nErrorCode when the execution time exceeds the specified timeout. This command is not available for all devices. Error handling: see readme for details. Examples
DescriptionCode
Wait for the position value at index 0 to reach 30 mm (window +-0.02 mm) within 1500 ms. call griplink:waitval(x_nPortGripper, 0, 30, 0.02, 1500, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Modification. New function signature with floating-point support. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top public wstr(num x_nPort, num& x_nDeviceState, num& x_nErrorCode)
Description of program This query can be used to detect the end of the previous state-manipulating command like GRIP, RELEASE, HOME, etc. Signature call griplink:wstr(x_nPort, x_nDeviceState, x_nErrorCode) Input parameters
ArgumentTypeDescription
x_nPort num (by value) Port index (0 to 31).
Output parameters
ArgumentTypeDescription
x_nDeviceState num& (by reference) Device state.
x_nErrorCode num& (by reference) -1 on parse failure; 0 on success; GRIPLINK controller returned an error code 1-27.
Notes The query waits, until a device state transition occurs and returns the new device state. If no state transition occurs, the query returns with a timeout error via x_nErrorCode. Error handling: see readme for details. Examples
DescriptionCode
Wait for the next state transition on port x_nPortGripper and retrieve the new device state call griplink:wstr(x_nPortGripper, x_nDeviceState, x_nErrorCode)
History
DateAuthorDescription
11-05-26 H. Efkere Creation.The query waits, until a device state transition occurs and returns the new device state. If no state transition occurs, the query returns with a timeout error via x_nErrorCode. On success, writes 0 to the by-reference output parameter x_nErrorCode.
Back to top