f3dps2

Help with SEND function block

16 posts in this topic

Hi all, I'm trying to send a 1 or 0 across a FINS network to a CP1L PLC depending on the state of an input on the NJ PLC which was easy enough with CX-One and the old CJ1M PLC, but Sysmac Studio (as usual) is making this a complete nightmare. Mainly because this function block doesn't appear to exist in the instruction reference for the program so there's no help built in. Here's the function block. I have defined the DstNetAdr variable as Send1NetAddress of type _sDNET_ADR, and the Option variable as Send1Option of type _sRESPONSE. My question is: without using a structured text program, how do I define the Send1NetAddress as looking for Network 0, Node 120 and what options need to be defined for the Option variable? I tried putting "(NetNo:=0, NodeNo:=120, UnitNo:=0)" into the AT field under global variables but it throws up an error saying it's invalid. I can't find examples of this data type anywhere so I really don't know what the syntax is. Also I know i've got the SrcDat format wrong and will try figuring out how to set that later. Thanks in advance

Share this post


Link to post
Share on other sites

f3dps2 I agree that not having a help reference for send / receive makes them a little tricky. Once you understand the variables that you need to pass in, I think the NJ makes this easier than the CJ PLCs, and I have done SEND / RECV in CJs for many years. Attached is a screen shot of a working SEND instruction. I do have network 1 defined as the built in EtherNet/IP port. I have defined the Net, Node, and Unit using the Initial Value setting. CommPort is not used, so set this to _NONE. You define the destination memory area using a variable of _eArea type, and you can put _DM, _CIO, etc as the value. Just use the _ character, followed by the memory area. You will see a drop down list once you start to build it. If this does not help keep you moving forward, let me know. NJFINSSend.bmp NJRoutingTable.bmp

1 person likes this

Share this post


Link to post
Share on other sites
PMCR, I can't thank you enough. You pointed out that I was making a very silly mistake - putting the initial value information into the 'AT' field. One further question since I'm still wrapping my head around this: I have a DeviceNet input bit coming in on 3318.07, and if this bit is on, I want to SEND a 1, if it's off, SEND a 0. Supposedly simple stuff, but how do I achieve this using a WORD[] array? Thanks again

Share this post


Link to post
Share on other sites
The easiest way to do this is to send a whole word, with either a 1 or 0. There is plenty of room in the memory of the CP PLC, so you are not giving up anything, and it is no faster to send a whole word of data than a bit, because of how FINS works.

Share this post


Link to post
Share on other sites
Sensational. You are a scholar and a gentleman, sir.

Share this post


Link to post
Share on other sites
Hi PMCR, I am also trying the same thing. I have NJ contr., cp1l-m30 plc and cp1w-cif41 ethernet opt. board. I want to comm. them via fins. As your screanshot i did the samethings but i am not succed to send a data from NJ to CP1L. I took some scrnsht, could you look that and suggest me which points am i wrong? I am using first option port of CP1L. I didnt anything CP1L just change ip address of the cif41. Thanks in advance. Have a nice day. http://i.hizliresim.com/ZDN9n0.png http://i.hizliresim.com/l7YO4l.png http://i.hizliresim.com/VVprBq.png http://i.hizliresim.com/vEzjyO.png http://i.hizliresim.com/1yPJ71.png

Share this post


Link to post
Share on other sites
In the destination net, node, and unit, you are sending to Node 10. Your CP1W-CIF41 setup shows that it is node 2, so you should have node 2 in your Destination Node. Also, do you have a FINS Routing Table in the CP1L? You will need one.

Share this post


Link to post
Share on other sites
Thnx a lot, it was done, as you say after create a routing table in CP1L i could use the send and receive funct. blocks in nj. Thank you so much again. Have a nice day. http://i.hizliresim.com/ZD1ky0.png

Share this post


Link to post
Share on other sites

Hello, i also have problems with the send Block due to no instruction help in sysmac studio.

My problem is the syntax of the _sDNET_ADR, i can't figure it out what to put in th AT Field in sysmac studio.

I'm also not sure what to put in to the port on the send block that is named option and have the data type sresponse.

 

All the pictures for this post is not possible to see anymore, i think they could be heplful:(

 

Share this post


Link to post
Share on other sites

Both Send and Recv instruction don't have any help files, since Sysmac tried it's best to discourage usage of Omron older PLC functions. Basically these two FBs works the same as SEND and RECV instructions in CX-Programmer, so you can actually refer to the CX-Programmer counterpart to get to understand the meaning of the inputs.

Since I don't know what are you trying to accomplish, I'll just put up a sample here on how this instruction is used. It may or may not work, depending on you network configuration.

Personally I use this instruction when I need to communicate from NX/NJ PLCs to CP1/CJ/CS-Series PLC. For NX/NJ to other NX/NJ, I prefer to use Ethernet/IP.

Capture.thumb.JPG.90cc4d05dd4e3174bc27d7

Share this post


Link to post
Share on other sites

Thank you innoaloe! Your post was of great help:)

I managed to send the word I wanted to from the NJ PLC to the CJ PLC through the built in Ethernet ports.

But now i am struggling to send a Word from the CJ PLC to the NJ PLC. I tried the recieve Block in sysmac studio, but i did not manage to get the information i wanted, Any tips for an Omron amateur:-)?

 

 

Share this post


Link to post
Share on other sites
On 1/27/2018 at 6:37 AM, Sysmac1980 said:

All the pictures for this post is not possible to see anymore, i think they could be heplful:(

@Sysmac1980: I repaired the link for the pictures above if you would like to see them.

Share this post


Link to post
Share on other sites
On 1/29/2018 at 2:09 AM, Sysmac1980 said:

Thank you innoaloe! Your post was of great help:)

I managed to send the word I wanted to from the NJ PLC to the CJ PLC through the built in Ethernet ports.

But now i am struggling to send a Word from the CJ PLC to the NJ PLC. I tried the recieve Block in sysmac studio, but i did not manage to get the information i wanted, Any tips for an Omron amateur:-)?

 

 

Hello, just got back to check it.

What I had in mind is that for the Rcv Function Block you use similar parameters as what I posted above. For Rcv Function Block the major difference is with the Option.isNonResp part, which you need to set to FALSE.
 

In the Send FB, we can just send the data and ignore any acknowledgement from the other PLC, that's why the Option.isNonResp was set to TRUE in my previous example. You may also change it to FALSE so you can be sure that your data is sent correctly to the other party.

In Rcv FB case, actually the NJ will send a request code to the other PLC when this instruction is sent, then in order to fetch the data, it has to receive the response from the other PLC. That's why for Rcv you must set Option.isNonResp to FALSE in order to be able to fetch the data.

So it should be something like this :

Capture.JPG.95973e13609be7ec0e6a115134ed

Share this post


Link to post
Share on other sites
On 1/30/2018 at 11:14 PM, Michael Walsh said:

@Sysmac1980: I repaired the link for the pictures above if you would like to see them.

Hi, it would be great if you could repair the link for all the picture. I would really appreciate it. I'm totally lost :(

 

Share this post


Link to post
Share on other sites

@control-amsb I do not see any pictures that are not already fixed.  I only see some links to some pictures that a user put in the posts.  If the links that were shared are no longer valid, I cannot fix them.  You could try to contact @ozeufu and see if he / she can fix the links or share the pictures.  Or, if I am missing something, please let me know and I will try to fix it for you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now