Profinet s7net + labview

Hello, Im using profinet s7net com to conect my pc with labview and a plc cpu.

Im requesting the contents of a certain DB and reading it from the plc memory in to labview.

When using a s7 300 cpu the comunication works fine.

When using a s7 1500 cpu the comunication also works but with some difference.

If I set a bool variable at the start of the plc cycle to false, and at the end to true (its false while the plc code is executing) i would expect my comunication not to be able to see the value false, as the data memory should be read when the plc code is not executing. This was the case with s7 300 cpu but not with a s7 1500. Its seems as if the read request are capable of reading the db at any point of the code execution and i see the bool variable as true or false depending on when i read (the comunication is constantly asking for the contents of the db).

Is there any configuration in the plc that would force the profinet controller to read the db memory in between plc cycles? The plc should recibe the read request from the pc and execute the read once the code is done executing. (note that no configuration of the connection is needed in the plc side, just conect the pc ethernet card to the cpu profinet port and send the correct request message using the profinet s7net driver and the plc answers).

Is there any configuration or settings or function in the s7net com driver that could tell the plc that the reading request should be execute in between plc cycles?

Ty
 
Yhe it might be a work arround, but i have read, write and read/write variables on the db, so it might be a bit more complex but i guess ill have to do something like this
 
I read this:

To synchronize PROFINET communication with the PLC's cycle, you need to configure synchronization domains and potentially use Isochronous Real-Time (IRT) communication. This ensures that data exchange between the PLC (as the IO controller) and connected devices (IO devices) happens at specific, predictable intervals, synchronized with the PLC's cycle.

Some one knows a good guide to set up this in my case? I tryed to add a pc device with profinet card in the project and configure the domains but was unable to do so. Somehow i cant Change the domain settings and i dont see the IRT mode option. + I dont know if for this to work some other configuration is needed on the pc/labview and if its suporte by the s7net driver
 
Ill end up doing the following:

Since the DB has read, write and read/write data i need a work Flow that allows this exchange.

I Will Copy the whole db to a read only buffer that Will get the data from the plc to labview. This buffer Will be written at the end of the plc cycle.

To be able to write to the DB ill implement a recive DB that Will get the data from labview. Labview Will send the data along with the adress and data type information to this db. At the start of the plc cycle, if a write Flag is set by the reception of data, the plc Will modify the requested data on the target db acordingly.

Note: after much reading i have concluded that the newer plcs are much more complex than s7 300 and have a lot of paralelization. Unforunately there is no option to sync the put/get memory reads and writes outisde of code execution time. With s7 300 this were slower but simpler and this worked, but not with s7 1500
 
Copy the data to a buffer at the end, or beginning, of the scan cycle, and read the data from the buffer.
But the 1500 has no method to copy data which cannot be interrupted by HMI communication, like UBLKMOV in the old S7 controllers. The only option is to place the method in an interrupt with a priority above HMI communication. I don't know if S7-1200/1500 user (and Siemens) are aware of, that you cannot read strings 100% consistent from an HMI without this method.
 
But the 1500 has no method to copy data which cannot be interrupted by HMI communication, like UBLKMOV in the old S7 controllers. The only option is to place the method in an interrupt with a priority above HMI communication. I don't know if S7-1200/1500 user (and Siemens) are aware of, that you cannot read strings 100% consistent from an HMI without this method.
I think UBLKMOV does exist in 1500. Besides, it highly unlikely that you read mid instruction, as tipically the com is much slower than this. And even if you do read in the middle, you still avoid mid-cycle calculation values as the buffer is moved at the end of the plc cicle, at most you would have to wait one more com cycle to get unupdated data.
 
I think UBLKMOV does exist in 1500. Besides, it highly unlikely that you read mid instruction, as tipically the com is much slower than this. And even if you do read in the middle, you still avoid mid-cycle calculation values as the buffer is moved at the end of the plc cicle, at most you would have to wait one more com cycle to get unupdated data.
UBLKMOV does not exist. And I've tested writing strings "aaa" and "bbb" with 100 chars from the Plc program, and 1 in 100 reads does read partially aaa and bbb in the string. I do my programming not if some error does "unlikely" not happen.
 
But the 1500 has no method to copy data which cannot be interrupted by HMI communication, like UBLKMOV in the old S7 controllers. The only option is to place the method in an interrupt with a priority above HMI communication. I don't know if S7-1200/1500 user (and Siemens) are aware of, that you cannot read strings 100% consistent from an HMI without this method.
Good point. Bumping the copy-to-buffer to a higher priority interrupt might bring back the original problem of an inconsistent buffer.

I think copy-to-buffer needs to be in the normal priority, but write a value of 0 to a bit in the buffer before the copy and write a 1 after, and then labview can check that bit and discard the read data if that bit's value is zero.

(I wrote that a while ago, but forgot to post it - sorry 'bout that!)
 
If labview can write to the PLC, you could also set up a mutex/semaphore to ensure either action, the read or the copy-2-buffer, cannot interrupt the other, or more specifically, cannot execute at the same time.
 

Similar Topics

Looking for "GSDML 6SL3040-1LA01-0AA0 Version 2.32". Badly need it, thank you. I've already look up in the siemens industry support but there's...
5
Replies
201
Views
We have an S7-300 CPU 317-2 without an integrated PROFINET interface, so we installed a CP 343-1 (6GK7 343-1EX30-0XE0, V2.4) to connect our...
2
Replies
175
Views
Hi all, Got a bit of a strange one on a conveyor and wondered if anyone has seen this before. I’ve got a Siemens G120C running an indexing...
4
Replies
252
Views
Hi, Looking for a little help. I changed an ET200M module from a Profibus module to a Profinet module. There are a number of I/O cards on the...
0
Replies
117
Views
Top