Sign in to follow this  
Followers 0
OdinPT

Connecting Scanner To CJ1M with RS232C

32 posts in this topic

Hi, Once again i ask for someone Help... After reading a lot of forum topics, i can't seem to understand what is happeing, and why im not recieving any data from the Scanner... I have the done a cable to connect the Scaner RX(2) TX(3) and GND(5) to the RS232C Port on the PLC. In the PLC side i have RX(3) TX(2) and GND(5) is this Ok ? Whats the diference between the RS232 and the RS232C cable ? The communication in the PLC doesn't go on so i think is the cable problem. Hope someone could help. Thanks.

Share this post


Link to post
Share on other sites
Pin 5 at PLC side is not ground ! Use the CPU manual as reference for port pinouts. This thread might also help. A short tip; short pins 4&5 at PLC side. Otherwise it will not transmit and/or process any data.

Share this post


Link to post
Share on other sites
Also, have you "setup" the port for RS232 communication? Default would be Sysmac Way (Hostlink) I think. Regardless, you will need to change it to RS232 and the correct baud, start bits, stop bits and parity. After setting up the port, I would recommend you power down and power up to make sure the port is reset. Hope this will help.

Share this post


Link to post
Share on other sites
Hi, Once again thaks, it was the GND it wasn't in Pin9... But now when the Scanner triggers it shows the COMM sig light up, the HEX value changes but in the memory map no information is found... and i have to store info in D500, what could it be ? :| if the HEX value changes is each time the scanner makes a good read is because is recieveing something right ? Thanks.

Share this post


Link to post
Share on other sites
It is a little difficult to verify the code due to the Symbol names instead of addresses. You are saying that the HEX value is changing, which value is changing? What address is the bottom node of the RXD instruction? Also what address is the top node? The Reception Complete Flag will not turn on until an "end of string" character is detected, or the "number of bytes received" is reached. These are configured in the "Settings" for the Host Link Port. You could try a "manual" trigger of the RXD instruction by putting an internal bit in parallel with the Reception Complete flag in your logic and see if the data is moved to the proper location. I hope this makes sense and is of some help.

Share this post


Link to post
Share on other sites
Are you monitoring the D area : or am I looking at an upload image (Transfer from PLC) ? : I can't tell from your screenshot but you understand this makes a difference. I asume that if the 1st line of the RXD is selected the screencopy of the Set value belongs to this symbol and thus it is D500. You have pins 4&5 connected at PLC side ? If you only need to monitor 1 or a few words, put these in the watch list. Then you can monitor the ladder and have an instant view on these values at the same time. I see that you have configured the data type for D500 as unsigned integer. Just a general cause, only if you configure the symbol as "CHANNEL" you will have "what you see is what you get" values. Just so you are not mislead by this.

Share this post


Link to post
Share on other sites
Thank you very much for both explanations, ill have to study what you have told me because im very noob in the automation world, and i have other projects in hand... but Ill reply with the news as soon as possible. Thanks. Edited by OdinPT

Share this post


Link to post
Share on other sites
As quoted by Jay Anthony: In the end, all data is stored in the Omron PLC as hex. Any other data type is a conversion from what you see in CXP. Stick with Channel and Bool until you internalize this fact.

Share this post


Link to post
Share on other sites
Gee, I didn't know y'all remembered.....

Share this post


Link to post
Share on other sites
I knew this would lure you out of your cave

Share this post


Link to post
Share on other sites
I'm a regular lurker....

Share this post


Link to post
Share on other sites
I can tell by your post count

Share this post


Link to post
Share on other sites
Hi People, First of all i want to thank you both for the explanations, and to ask sorry for the delay, believe me is not my fault... but it depends on wich project im working with. Second i want to say that i studied Automation but never worked again with PLCs... and now sometimes someone askes to try to do some crazy projects and i have to study and ask for your help :p Well... Questions... The Area is The Monitor Area and yes the 4&5 are shunt. I think the communication problem is solved, yet i have a dought about it. The RXD function has to have allways the Reception_Complete on to recieve any data ? If i put the value A396.06, it stays allways off but when there is a send from the scanner he position in memory (D500) if filled with the value. If i put the value A396.05, it stays allways on but no value is sent to (D500). I don't understand very well... Now, i have the Scanner communicationg with the PLC and the PLC recieving the info. I used the RX/TX example in the download section, the idea is to control the sequence from the data from the scanner. The Data From the scaner is someting like: .... 038034 038035 038036 038037 038038 015000 015001 015002 015003 .... First 3 Digits are the total pages from the set the other 3 are the current page. If there is any reading error it sends the value "5". Im thinking on doing this puting the actual read in D500 then in the next read i put the last read in the D400 (for example) and compare if the actual is = to the last+1. Well, this is programming issue you don't need to get involved in this part, ill try to handle this myself later. My problem, and its because my lack of experience and knowledge, is in how to work the information... The scanner is allways ON and when it finds a code it sends to the PLC, so i don't have any trigger or any "data send" signal. The info from the scanner is stored in the D500 position, i know that the data from the Scanner is 6 digits bue when appears an error it stays something like this... ... 038035 538036 <----- 038037 038038 ... and it should be... ... 038035 5 <----- 038037 038038 ... Because it has the last value in the D500, how can i clean the word right before a new value goes to the D500 position? Well... i think this is enough questions for now.. Hope someone could help, and sorry for my english... i can try to explain better the situations. Thanks. Edited by OdinPT

Share this post


Link to post
Share on other sites
Perhaps you could compare D500 with the error code, and if you get an error read you don't process the received data, but only use the D500 value. I think you will need to use the data reception flags to process the data further to your ladder destination.. I am not familiar with this particular instruction so hopefully someone else will be able to help you in more detail.

Share this post


Link to post
Share on other sites
Not sure what happened but the RS232 port Reception Complete Flag is address A392.06 (NOT A396.06). A392.05 is the RS232 port Ready Flag. How is the Host Link Port (RS232) "set up" under settings? Does the bar code reader add a CR (carriage return) or a CR+LF (carriage return, line feed) on the string? This will determine how the Reception Complete Flag will function. Try to include a screen shot of the Host Link Port set up in your next post. Also if you can let us know how the bar code reader is sending any end of string characters. Let us get the instruction working first, then we can take a look at handling the data? Edited by gtsuport

Share this post


Link to post
Share on other sites
Hi, I really don't know for sure if it sends CR (carriage return) or a CR+LF (carriage return, line feed), but i think is CR+LF because it does allways a line feed after a reading in the Terminal... is that it ? There is the picture of my comm settings, i think they are ok since whe number that apears in the D500 is the number im trying to read from the barcode. There are 1 Image with 4 readings from the barcode scanner... Edited by OdinPT

Share this post


Link to post
Share on other sites
Based on the settings shown, A392.06 should turn on when the scanner sends the data to the plc, and that should energize the RXD instruction. Have you tried to change the bit A396.06 to A392.06? If yes, is the RXD instruction now moving the data into D500 when the scanner reads? Once we can get the A392.06 bit working, we can deal with moving the data around as you desire. Let us know how it goes.

Share this post


Link to post
Share on other sites
Sorry i modified my last post, yes the reception bit is with A392.06 but it doesn't go on when a reading is sent to the PLC, and yet data is sent to D500 :|

Share this post


Link to post
Share on other sites
Actually it probably is going on. It will only be on a VERY short time and you may not be able to see it with the computer. The Reception Complete Flag turns on when the CR + LF is detected and turns off as soon as the RXD instruction transfers the data to the destination (in your case D500). At this point, the RXD instruction is working, correct? The only contacts before the RXD is the A392.06, correct? If this is correct, please post to explain what you need to do next.

Share this post


Link to post
Share on other sites
Yes, it seems to be working i have the scanner reading as you can see in post #17. Communication Ok! Well... next i would like to someone give me some lights on how can i control the sequnce in the image... comparing allways the current value with the last one.. and to validade too when an error ocurrs, value 5.. My ideia is to, each time, i recieve a value i compare with the value in D600 (for example) and if its = to the value in D600 +1 then its ok if not gives error activating an output. I don't know well how to do this.. but i know that for now i at least need to know how to "clean" the D500 after done the compare and the move from D500 to D600 to be ready to get other value... hummm... was i clear ? Edited by OdinPT

Share this post


Link to post
Share on other sites
Try this. In a rung BEFORE the RXD instruction, use a @XFER instruction. XFER (Transfer) instruction: Top node is number of words to move, middle node is source (D500) and bottom node is destination (D600). This will move the current data in D500 - D5xx, to D600 - D6xx. xx will depend on value in top node. Next rung use a @BSET (Block Set) instruction. Top node is value to set, middle node is first address, bottom node is last address. So if you want to set zero in D500 - D515, top node value is #0000, middle node is D500, bottom node is D515. Made SURE to use the @ symbol in front of instruction (@XFER, @BSET), This way they are only on for one scan. Use A392.06 bit to execute the rung. This way D500 data has been copied to D600 and next rung the data has been cleared (set to zero) in D500. Then the next rung could be the RXD instruction and the new data will be moved into D500. This should get your data moved as you have indicated. The "5" error thing is a bit more difficult. If you know which D memory location to check, you could use a compare instruction to see if 5 is in that location, after the RXD. We may need to "talk" more about that. Hope this will help.

Share this post


Link to post
Share on other sites
It seems perfect to me ! Ill try it as soon as possible!! one more thing ! what do i use to activate the XFER function ?

Share this post


Link to post
Share on other sites
Sorry about that, use the A392.06 Reception Complete bit. Everything will be done in one scan.

Share this post


Link to post
Share on other sites
Doesn't seem to work he doesn't move the word before doing the scan... The A392.06 is activating because if i change to A392.10 (for example) there isn't any data changing in the plc memory, with the A392.06 is too fast and i can't see it but the data is really sent. But the movement and the bit set is not working... Edited by OdinPT

Share this post


Link to post
Share on other sites
Put the BSET instruction before the RXD. You want the range to be cleared before new data is received right!? The BSET is actually a Block set instruction, meaning it sets a predefined value to a predefined range of words. Put the @ symbol before the instruction name just as the @XFER.

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