Tsend/Trcv: Variant & Any datatype

LindeBerger

Member
Join Date
Nov 2023
Location
DK
Posts
12
Hi there!

I have a question to a (maybe) simple issue that I hope some of you can help me with.

I''ve made an FC containing the TCON, TDISCON, TSEND, TRCV blocks.

The FC has been implemented in a 1515 CPU, 1215 CPU and in a legacy ET200S (not SP!) CPU.

The 15xx/12xx CPU's use the "VARIANT" datatype to pass on the send/receive data while the ET200S uses the "ANY" dataype. This is system/CPU dependent according to Siemens.

And here's my obstacle:

With the 15xx/12xx CPU I can easily flesh out my "send" structure in my UDT-strcture via InOut (see picture)

However, this is not possible in the legacy ET200S CPU. I get an instant error (see picture).

Is this because of the VARIANT vs. ANY datatype?

Tsend.png Tsend_legacy.png
 
You need to contruct the any pointer you pass to the TSEND block at runtime from the InOut data. I'll post an example in due course.
 
You need to contruct the any pointer you pass to the TSEND block at runtime from the InOut data. I'll post an example in due course.

Hi! Thanks for your reply.

Much appreciated for your help. I'll try to be more specific with my issue in the meantime. I've added some more info and a screen shot of my UDT-structures.


I don't have much experience with the VARIANT and ANY datatypes.

The text below is from the F1 help of the "legacy" CPU. I've highlighted the last paragraph in bold/red which I think is the answer to my problem but I'm not sure if I understand it correctly. It seems like I'm only able to do this by having a separate datablock for the send/receive in my case with this specific CPU? I don't have this issue with the 12xx/15xx but these CPUs also use "VARIANT", not "ANY"....

========================================================

Parameter: DATA

Declaration: InOut

Data type:ANY

Mem area: I, Q, M, D

Description:

Send area, contains address and length
The address refers to:

The process image of the inputs

The process image of the outputs

A bit memory

A data block

Note: Do not use ARRAY of BOOL as send area.

Note: You can enter the DATA parameter in these two ways:

absolute. Example: P#DB13.DBX0.0 byte 64

symbolic. Example: DB_name.variable


/All the best

Tsend_legacy_consolidatet.jpg
 
Last edited:
Hi again!

Thanks again for your time to make a program snip related to my issue.

However, I'm very limited in STL so I didn't integrate your solution into my project as I want to understand it first before implementing it blindly - how else am I going to learn, right? :)

It seems my problem gets stranger when testing between an ET200S/IM151-8 and a 12xx/15xx.

I have 3 12xx and 1 ET200S/IM151-8 in my project and all 3 12xx CPU's are communicating flawlessly and sending/receiving data with eachother using the same T-blocks, same UDT-structure and logic. All are connected through the same default port.

It's only the IM151-8 that's behaving strange. It receives data from the 12xx CPUs but it's not sending the data - I get no "NDR" on my TRECV-block on the 12xx CPUs from the IM151-8. Strangely I also get no error.

I also made a quick and very simple program using the T-blocks and trying to exchange data between a 1215 and the same IM151-8 CPU. No UDTs where used or InOut in the block interface. Just simple separate send/receive DBs with 5 variables of REALS.

Communication is fine but I get error 16#8092 in both TSEND/TRECV in the IM151-8. This error code is not presented when doing an F1 for the TSEND/TRECV.

If it's any help, I can upload the ZAP-file of the project.

Thank you all for your time and contribution

TconClassic.png
 
Upload/send the zap please.

PM sent. Thank you!

Screenshot below is my issue:

Connection is fine. The data sent from the "new" CPU to the "Classic" CPU is fine. However, data sent from the "Classic" CPU is not being sent and therefore not received in the other end.

Tsend_legacy.png
 
Hi members!

I actually think I know what my issue is. I'm almost certain that it's because of the "Variant" datatype used in the TSEND/TRCV-blocks on the 12xx/15xx CPUs and the "ANY" datatype used in TSEND/TRCV-blocks on the S300/S400 CPUs.

I need to send the complete/whole structure of the DB with the old CPU.
With the newer CPUs (12xx/15xx) I can pinpoint a specific UDT structure in the DB to be sent/received. I just tested it and it works.

See pictures attached.

My question is: how on earth do I solve this the best way if I want to keep the structure I have now with the newer CPUs - is it possible?

ANYvsVARIANT_notWorking.png ANYvsVARIANT_working.png
 
P#DB10 DBX0.0 points symbolically to full DB block so lenght is known. P#DB10 DBX140.0 poits to address between so I assume that lenght is not known anymore. Try whit byte lenght parameter P#DB10 DBX140.0 Byte 10 if you want move 10 bytes starting from DBW 140.
 
P#DB10 DBX0.0 points symbolically to full DB block so lenght is known. P#DB10 DBX140.0 poits to address between so I assume that lenght is not known anymore. Try whit byte lenght parameter P#DB10 DBX140.0 Byte 10 if you want move 10 bytes starting from DBW 140.

Hi Lare!

Thanks for your reply. Unfortunately I already tried this to no avail - like e.g. P#DB20.DBX40.0 BYTE 30 (as the send package is 30 bytes).

I can still send from the 1215 to the IM-151-8 and the IM-151-8 receives the data but not vice versa.

This is really a head scratcher for me. o_O
 
I can still send from the 1215 to the IM-151-8 and the IM-151-8 receives the data but not vice versa.

This is really a head scratcher for me. o_O

Have you rebooted 151-8 CPU after hardware and software download? Remembering that there was some issues with put / get coms years ago after first download if not rebooted. Coms just didn't work right. Partner CPU was s7-300 at that time.
 
Between Siemens PLC why not using S7 connections. Or if less data transmission you could use I-Device to map the IO between master and slave PLC.
 
Between Siemens PLC why not using S7 connections. Or if less data transmission you could use I-Device to map the IO between master and slave PLC.

Hi!

The Functions I'm building are going to be used for TCP/IP comms between lots of PLCs and IFIX SCADA. So there will be a moderate amount of data being interchanged. :)
 

Similar Topics

Hi, I want to send a whole DB and all it's values(arrays,ints, words) with TSend - does any one know how to do this? It is no problem to specify...
Replies
2
Views
1,794
I'm in the process of converting a program over from Step 7 5.4 to Portal 13... One of the instructions being used is the TRCV instruction which...
Replies
8
Views
4,908
Hello, I want to know how the FB 65 TRCV really works (besides help from S7). The project configuration for TCP (CPU 319 3PN)...
Replies
1
Views
5,863
Hi, I'm just trying to work out how to compare a variant type. The variant input parameter needs to be compared with a min and max limit. If it...
Replies
4
Views
2,127
I am running Excel XP and RSLogix 5000 ver 13 with RSLinx Classic. I am trying to check if the Variable - EndBag is equal or not equal to 0...
Replies
0
Views
2,650
Back
Top Bottom