Sign in to follow this  
Followers 0
gamerayers

FINS Serial C Code

4 posts in this topic

I am working on a DOS based program. At first I thought I was going to be using C-mode, but from my conversations with Omron, FINs would be much better. I was wondering if anybody had sample code written in C (even for windows) which shows FINS communication over serial. The program I am looking to make reads DM4000 for 18 words, and writes DM5000 for 42 words. I would like confirmation of read and write, but I might use an DIO which is in the PC to do this. If anybody has any code that will even put me in the correct direction, that would be great. Thank you.

Share this post


Link to post
Share on other sites
sec4.pdf Don't know if this is any good for you. Found this on the Compolet cd (Omron Finsgateway thingy!)

Share this post


Link to post
Share on other sites
Okay, I think I am on the correct track. The only problem I have no is no matter what command I issue over serial I get a @00FA1345* as the response. I do not know what that means. I also don't know if I am supposed to include the @ and the * in the fcs. Thank you.

Share this post


Link to post
Share on other sites
Hi Gamerayers, Do you have the omron manual W342 - which describes the Fins protocol ? A great help would be to download the 'Multiway' software available from this site. It is a communications terminal program which supports FINS over TCP and serial. (You will probably be using FINS - Hostlink which depicts 'FINS encapsulated in hostling' - this is an ascii protocol) Your Error Code: @ - hostlink header 00 - node 'zero' FA - fins protocol 'header' 13 - end code (13 means FCS error) - see section 4-2 in manual W342 for end code table (00 is good) *CR - hostlink terminator You will need to write an 'FCS' calculator in C if you wish to to send data to the PLC, as the FCS is required. Each time you write the 42 words, the FCS should be calculated on the send data. An example for this is given in section 2-3 of manual W342. - if you have difficulty here, I may be able to dig up some alternate source code. You can probably use a static 'request' for the read 18 words starting from dm4000 - this would be: @00FA0800003000000000000010101820FA000001273*<CR> Response would be: (would vary if data changes) @00FA00C00002000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000037*<CR> The relevant sections of Omron manual W342 is section 3, also make sure you look at section 3-5 which describes how Fins commands are encapsulated within hostlink. I hope this helps to point you in the right direction. Note: For your application (read 18 words, write 42 words), the 'C-Mode' (otherwise know as host link or sysmac way!) would be OK, and may be easier to understand. Note that C-Mode does have limitations and cannot access all data areas/commands of newer PLC's. Kind Regards Nibroc

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
Sign in to follow this  
Followers 0