Dareko009

Omron CJ1m - bluetooth connect

19 posts in this topic

Hi,
I write app to smartphone to communication omron CJ1m and Android. I want to connect devices by standard bluetooth. I plug in bluetooth adapter directly to omron RS232. 
I want to ask you, how i can connect by FINS command.
Bluetooth device baud rate is set 9600.
If i connect to omron, i sent code: "AC01" and i sent how long as omron return me "AC01" ??
And what's next command i sent?
If I want read CIO 10 i sent: "0101B000000A" ? and FCS and "*" ??
how i calculate FSC? Is it XOR my data sent? 

Edited by Dareko009

Share this post


Link to post
Share on other sites

Here is an FCS Calculator at Mr PLC's downloads section. http://forums.mrplc.com/index.php?/files/file/174-fcs-frame-checksum-calculator/

The manual that want to reference is the CS/CJ Communications Commands Reference Manual W342. You'll want to use Host Link protocol for RS232 communications. FINS is used for Ethernet.

Share this post


Link to post
Share on other sites

Thanks for answer.

I look for answer to my question in this documencation and i can't find it or i can't understand it. 
In this documentation i can't find anythink about command "AC01" to check connection.
I search answer in Net and i found http://www.tri-plc.com/HostlinkE10.pdf 
In 1st point is Poin-to_point communication and what i know about my communication it will look at this...
But i don't know what i should write in Header? 
And my code would like:
Header + Command + Terminator? 
And what about reply? 

Share this post


Link to post
Share on other sites
Quote

If i connect to omron, i sent code: "AC01" and i sent how long as omron return me "AC01" ??

AC01 is an incorrect hostlink command.:shrug:  You will not get a response.

To read the first CIO word.  Try "@00RR0000000141*CR"

Quote

I plug in bluetooth adapter directly to omron RS232. 

What is your wiring?  The Omron RS232 port is non standard wiring.

Share this post


Link to post
Share on other sites

Please use the documentation that IO Rack sent you.  You are trying to use a different manufacturers documentation other than Omron hostlink.

http://forums.mrplc.com/index.php?/files/file/620-w342-e1-09-sysmac-cscj-series-communication-commands/

CS/CJ Communications Commands Reference Manual W342.

Share this post


Link to post
Share on other sites
Quote

What is your wiring?  The Omron RS232 port is non standard wiring.

RS232_Cable.JPG.21a02f9e725577982a0fb893

Quote

AC01 is an incorrect hostlink command.:shrug:  You will not get a response.

I talk with my professor  and he say that i must sent "AC01" hex and wait for response. It will work like:

https://www.myomron.com/index.php?action=kb&article=34

 

Quote

Please use the documentation that IO Rack sent you. 

I use this documentation and i can't find answer.

When i talked with my professor he said i haven't must sent " @ " and  my command would looks like:
 

komenda.thumb.png.df4e0e6002610547de18c3


And he say's it will work. 

It will work??
And what about terminator?? 
 

Share this post


Link to post
Share on other sites
Quote

The Omron RS232 port is non standard wiring.

Jumper 4 to 5

Quote

I talk with my professor  and he say that i must sent "AC01" hex and wait for response. 

This is for the peripheral port.

Quote

To read the first CIO word.  Try "@00RR0000000141*CR"

This is the correct protocol.  You are trying to use FINS protocol,

Quote

And what about terminator?? 

"" is the terminator.

Share this post


Link to post
Share on other sites
Quote

This is for the peripheral port.

@Jay Anthony Can you tell me how would like command look if i connect to PLC by peripheral port? 
Maybe i don't understand my professor and he want connect to PLC by peripheral port because he said about "AC01" and simple command FINS. 

Share this post


Link to post
Share on other sites

The peripheral port is for programming. use the serial port with the command I gave you.

Share this post


Link to post
Share on other sites

Toolbus is not documented.  What's wrong with Hostlink??

Share this post


Link to post
Share on other sites
Quote

Toolbus is not documented.  What's wrong with Hostlink??

Probably nothing.

But i asked my professor and he want use ToolBus communication.

In my program i will use only command to read and write word from and to omron.
In this forum i found, ToolBus command would look like:
 

Quote

Message format: Toolbus Header, FINS Header, FINS Command, Checksum.

Where:
Toolbus Header - AB00xx 
xx -  number of following bytes in message including checksum - number of bytes FINS Command and Checksum ?

FINS Header - if i connect whit PLC directly, i can skip FINS Header ?? 

FINS Command - it is standartd FINS Command, eg 0101 - memory area read + B0 - memory area code(word CIO area) + 000000 - read adres (word CIO 0),

Chcecksum -  sum all bytes of message to form 16 bit (two byte) checksum - it is sum with Toolbus Header or not??

This message is sent by byte?



 

 

Edited by Dareko009

Share this post


Link to post
Share on other sites

good luck.  Fire the professor.:stupid:

Share this post


Link to post
Share on other sites

Indeed Toolbus ain't documented, but using the Multiway program from Omron France, we can practically reverse engineer it.
Granted you are a student, I'm sure you have the time for doing that.
However, as Jay mentioned it is not really wise to do so. It's kind of wasting your time reverse engineering something that is undocumented, while you have something else that is already documented properly with the exact same usage (HostLink in this case).

And guess what? The said "AC01" command was actually documented here : https://www.myomron.com/index.php?action=kb&article=34

Surely it is not documented properly. If you want to try the command again, try sending "AC01" not as a String (in which you are sending 41 43 30 31 hex bytes), but send them as a raw hex bytes (so you are sending AC 01 hex bytes). I don't know whether that'll work or not since I never tried it myself. Good luck.

Share this post


Link to post
Share on other sites

Hey, sorry that i answer now.

I made app to Android to connect with Omron CJ1m but I found problem and i can't solve that.
If I write data to CJ1M e.g. 0x0033, PLC has write 0x0013. I send command by ToolBus and it looks like:

This command is like FINS command in documentation OMRON.

Can you any suggestion? 

zapisywanie.jpg

Share this post


Link to post
Share on other sites
Quote

0x0033

Not a valid Command Code

Quote

PLC has write 0x0013

End Response indicates invalid command code.

Read the manual here for FINS:

CS/CJ Communications Commands Reference Manual W342.

http://forums.mrplc.com/index.php?/files/file/620-w342-e1-09-sysmac-cscj-series-communication-commands/

 

Share this post


Link to post
Share on other sites

But i know,  i use to write command 0102 and data is 0x0033. I have end code 0101, that i Save correct but than i read this memory and it is 0x0013..

Share this post


Link to post
Share on other sites
Quote

i use to write command 0102 and data is 0x0033.

What register are you writing?

Quote

but than i read this memory and it is 0x0013..

Are you writing to actual I/O?  If so the hardware may be turning off the sixth bit,  Is there code in the PLC?  If so, the program could be turning off the sixth bit.  Try the command with the PLC in program mode.

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