How-to
Send VS725 measurements to an S7-300 over PROFIBUS
Short answer
Use FB72 simplified communication — one call on every scan from OB1 with its instance DB — instead of separate DP-send and DP-recv blocks. Configure the VSLink PB camera connection with 32 bytes of cyclic data in each direction, and start inspection mode in Spectation: without the running man the camera transmits nothing, even over a healthy PROFIBUS link.
On this page
The S7-300 only sees a measurement after three things are true: FB72 simplified communication runs on every scan in OB1, the VSLink PB camera connection carries cyclic data in both directions, and Spectation is in inspection mode. Miss the last one and the PROFIBUS link can look perfectly healthy while the camera transmits nothing at all. This article structures the chain from Spectation through VSLink PB into the PLC: which communication method to choose, the VSLink settings, the OB1 call with its address and buffer entries worked through for a real case, and the commissioning order that finds each fault at the boundary where it belongs.
Choose simplified communication with FB72 #
Between Spectation, VSLink and the PLC, use simplified communication for a camera that publishes measurement values every bus cycle. FB72 handles the complete transfer by itself, so the separate DP-send and DP-recv calls you may have planned stay out of the program. Adding them gives the same interface a second owner, and two sequences writing the same data is a fault you commission into the machine yourself.
Call FB72 cyclically from OB1, the main scan organization block, with its own instance data block — in the worked example below the block is named VS_S7_DP and its instance DB is DB72. One execution is not a substitute: the block must run on successive scans while measurements and communication states change, so keep the call unconditional and active during commissioning rather than behind an operator command.
Keep the memory roles apart. The instance DB holds the block's working state; the received and sent data live in application buffers in their own DB. Handing the instance DB to the block as a buffer as well corrupts both roles, so DB72 stores the call state and DB2 stores the data.
Set up the VSLink PB camera connection #
Create the camera connection in the VSLink software even when you never open VSLink for visualization. Mark the connection as VDX and enter 32 in the Profibus options so the connection exchanges 32 bytes of cyclic data in each direction. Check the two directions separately: setting the input length does not set the output length by itself.
Cyclic data is what the master and slave exchange on every bus cycle without an application requesting each transfer. It is not the PKW parameter channel, which is why the PKW words can stay empty on a link whose cyclic data flows — why PKW words stay empty while cyclic PROFIBUS data works covers that split in detail.
Match the PROFIBUS address set in the VSLink software with the address of the slave you place in the PLC hardware configuration, and keep the configured input and output lengths identical on both sides. After you compile and load, the online diagnostics must show the slave exchanging data with no address or module-configuration fault.
Worked example: the FB72 call for a slave whose I/O area begins at address 272 #
The inputs for this case:
- FB72 in the project as
VS_S7_DPwith instanceDB72, called from OB1 as set out above. - The slave's I/O start address, read from the hardware configuration.
- Receive buffer
P#DB2.DBX0.0 BYTE 128— a 128-byte area from byte 0 of DB2, covering bytes 0 through 127. - Send buffer
P#DB2.DBX128.0 BYTE 128— a 128-byte area from byte 128 of DB2, covering bytes 128 through 255. - Status words
RET_VAL_RECVinMW10andRET_VAL_SENDinMW12, so each direction keeps its own readable status.
The rule for the address: STEP 7 expects the connection's logical address in the LADDR input, and it reads a W#16# entry as hexadecimal, by place value: 1 × 256 + 1 × 16 + 0 × 1 = 272, so W#16#110 denotes the address 272. Typing the decimal digits 110 into the hex-formatted field instead selects 110 decimal, which is hex 6E and a different address. The buffer arithmetic follows the same read: the receive area occupies bytes 0 through 127 and the send area begins at byte 128, so the send range ends at 128 + 128 − 1 = 255, and DB2 needs a declared length of at least 256 bytes.
The call that matches this hardware:
CALL "VS_S7_DP", DB72
LADDR_CAM1 := W#16#110
RECV := P#DB2.DBX0.0 BYTE 128
SEND := P#DB2.DBX128.0 BYTE 128
RET_VAL_RECV := MW10
RET_VAL_SEND := MW12
The decision: if your hardware configuration shows the I/O area beginning at 272, enter W#16#110; typing 110 selects the wrong address, and the call reports an error or works on an area that is not the camera.
Keep the pointer ranges at their full length even though the bus connection exchanges fewer bytes per cycle — the pointers are the block's application buffers, not the connection, and shrinking the connection to make the numbers equal breaks the documented setup. Keep DB2's two ranges clear of unrelated writes, keep DB72 as the instance only, and if your configuration gives the input and output areas different start addresses, take the address-selection rule for LADDR_CAM1 from the block documentation rather than assuming either one.
Publish the measurement and start inspection mode #
In Spectation, the script line that publishes the distance is VDX_SetOutputFloat(5, dist.Distance). The 5 is the VDX output index the call writes to; it is not a PLC byte offset. Confirm where each output index sits inside the cyclic input area in the camera documentation before you point any display at DB2, and watch the softsensor dist.Distance during a test inspection to confirm it holds the value you intend — a value that looks right on screen proves nothing about the communication output until the script runs inside the inspection.
The communication settings follow the simplified-communication procedure in the Spectation communication manual: turn the Modbus output off, turn EtherNet/IP on, and select the Ether/VSlinkPB option in the VDX settings. That routing sends the published results to the VSLink PB transport the PLC reads, rather than to another channel.
Then start inspection mode with the running-man control in Spectation. Without it the camera transmits no inspection results at all, so a healthy PROFIBUS link, a correctly configured slave and a running FB72 can all sit next to a receive buffer that never changes. Run an inspection with inspection mode active and watch the receive bytes in DB2 move with the measurement.
Commission the chain in this order #
Work through the boundaries in sequence and confirm each one before moving to the next:
- Create the VSLink PB camera connection in the VSLink software: mark it as VDX, set the cyclic length for input and output, and note the PROFIBUS address.
- Place the matching slave at that address in the PLC hardware configuration, compile, and load it; the online diagnostics must show data exchange with no address or module fault.
- Set the Spectation communication options: Modbus output off, EtherNet/IP on, and the Ether/VSlinkPB option in the VDX settings.
- Load the publishing script and run a test inspection to confirm the softsensor publishes its value.
- Enter the OB1 call from the worked example, go online, and confirm the block executes on every scan with its instance DB.
- Start inspection mode with the running-man control, run a real inspection, and watch the receive bytes in DB2 track the measurement.
If the slave reports data exchange while the receive bytes stay frozen, first re-check inspection mode; if the link itself is the suspect, fixing an S7-300 PROFIBUS gateway that is detected but reads no I/O data walks the module-address causes on an S7-300. Keep the line's normal safeguards in place while you commission, and let downstream logic act on the received value only after it has tracked a real measurement through several inspections.
Questions asked
How does the measurement reach the TP170 A once FB72 is working?
The panel reads the PLC, not the camera. Create a tag on the TP170 A that points at the DB2 address where the value lands, over the panel's own connection to the S7-300, and give the tag a floating-point format. The camera chain needs nothing further for the display; if the tag stays at zero while DB2 changes, the tag address or its format is wrong, not the PROFIBUS transfer.
How many measurements fit through the cyclic input area?
A single-precision float occupies 4 bytes, so the 32-byte cyclic input area carries up to eight float measurements per exchange; more than that needs another connection or a longer documented cyclic length. Where each VDX output index sits inside those bytes is defined by the camera documentation, so check that mapping before you address a value in the receive buffer.
Can a second camera join the same FB72 call?
The interface carries inputs for further connections: the worked example fills only LADDR_CAM1, and LADDR_CAM2 through LADDR_CAM4 exist for additional cameras. Give each camera its own VSLink PB connection with its own cyclic area, and give every connection separate receive and send ranges so the areas cannot overwrite one another. Set unused connection inputs the way the installed block documentation specifies instead of leaving them unassigned.
Why do the VDX settings need Modbus off and EtherNet/IP on?
Those selections route the camera's published outputs onto the VSLink PB transport the PLC reads. The simplified-communication procedure in the Spectation communication manual disables the Modbus output, enables EtherNet/IP, and selects the Ether/VSlinkPB option, so inspection results leave through PROFIBUS rather than another channel. Configure exactly the documented path and treat the value arriving in DB2 during a real inspection as the only proof the routing works.