Mitsubishi FX2N-232IF Communication Help

johnfarrugi

Member
Join Date
Mar 2008
Location
London
Posts
99
I am working on a job trying to add a FX2N-232IF to a fx3u PLC. I have never worked on a mitsubishi PLC before, although I have years of PLC experience.
From what I see, I can just attach the rs232 module to the rack without changing anything in the program. is this correct?
The application consists of four keyence BL1300 barcode scanners connected to a keyence N-410 Master. When any of the barcodes read, the data is sent back to the FX2N-232IF module in the format:

STX %01 123456789 ETX

The %01 represents the scanner address number which sent the information.

From my understanding, I need to setup a few TO functions to setup the communication in the FX2N-232IF module. Then I need to request a read or FROM command in order to read the buffer in the module.
Does anyone have any examples of this type of code?
I am trying to figure out what happens if I get two scanners that send the information at the same time. How do I only read one command from the buffer?
 
OK, I have the barcodes communicating to the module and the module transfering the information in the buffers to a few D registers. Now I need to compare the values in the registers with a few constant value to determine which UPC product the barcode scanner read.
Are there ascii registers in the Mitsubishi PLC which will allow me to store a few constant UPC codes to compare against?
Right now the information from my barcode scaners span across 7 D registers as follows:
D100 = 01
D101 = 65
D102 = 33
D103 = 21
D104 = 23
D105 = 71
D106 = 4.

Which would should read 0165332123714 as a UPC code.
Which commands would I use to combine all those registers so I can store them into a single register to be able to compare the value with a constant?
 
The FX range have D registers these will store two ascii chars (16 bit), you can make the range of these D regs to retentative go to parameter device & you can set the range of D registers there, I know you are using FX3 but my current version has not got the 3 series only the 2 but I suspect the settings are simular, if you then go online, entry data monitor select the registers you want to put the fixed data into then type in the chars it will overwrite the data in those registers i.e. D200-dxxx then if you upload from plc & tick the device memory you will have a copy in case you need to re-load.
There are many ways to compare the chars if individual chars are required you could move them into single D registers & compare them as the Register will contain 2 chars i.e. QR if you want only the R then and it with 255 00FF hex
a little bit of juggling & shifting may be required.
 
OK, I have the barcodes communicating to the module and the module transfering the information in the buffers to a few D registers. Now I need to compare the values in the registers with a few constant value to determine which UPC product the barcode scanner read.
Are there ascii registers in the Mitsubishi PLC which will allow me to store a few constant UPC codes to compare against?
Right now the information from my barcode scaners span across 7 D registers as follows:
D100 = 01
D101 = 65
D102 = 33
D103 = 21
D104 = 23
D105 = 71
D106 = 4.

Which would should read 0165332123714 as a UPC code.
Which commands would I use to combine all those registers so I can store them into a single register to be able to compare the value with a constant?

I am also working on a project which is communicating multiple barcode readers with FX3U via FX232 to read 5 side of a parcel. Can you give me the code to write the barcode data into PLC FX3U D register. I have also read the FROM/TO instruction and N-410 module but i still don't understand how to use FROM/TO instruction to do so. Thank you very much.
 
Mitsubishi is a company with a long experience. They have a lot of interesting developments. But everything is not shared. This is considered the intellectual property of the company
 
Are you displaying them in ASCII format or decimal. this is important as you cannot have one register holding more than two chars, however if they are in decimal then you could multiply them by the divisor and add them up, again there are two problems, anything above 65,535 will require a double register & the leading zero will not be displayed. From what you have written this is probably ASCII in the FX I believe you will have to compare each register & if all the same then set a bit. It will mean you will need in stored registers all the codes you require. I once did a similar program, basically we did a teach function so you enter teach read a bar code, store it, then every time you read a bar code, compare it, if same then accept, if different the reject. We had a Beijers HMI connected & using the recipe function in the HMI we could store the Bar codes, the operator selected the bar code to use from the recipe & then processed all read bar codes. If you could tell us exactly what this application is doing it would help.
To do a compare of the 7 registers you could use a FOR Next Loop and indirectly address the registers.
 
The from/to instructions are to set up intelligent cards for example to set the Analog cards you use the TO & From instruction this comprises of the card address i.e. if first card in extension then this is card 0 you move data into the buffer memories of the card (BFM) for communications (depending on card) you use the move instruction to set the bits/values in registers D820 > download the manuals they are very helpful.
 
Multiple bar code readers on 232 is not practicable, 232 is point to point, connecting multiple TX data lines from more than one point will corrupt the data, you will need RS422 or 485 so that the TX/RX lines have a Non state.
You will also need to send addresses from each bar code reader so that the FX will know which one has sent the data.
It depends on what software i.e. GX Developer, GXWorks etc. you are using as the later IDE's allow you to configure the communication cards without ladder programming.
 
This logic does a compare of D registers (7 off) First set the pointer registers to the D memories you want to compare (D100-D107 and D120-D127), then do a for next loop what it does is first reset the compare memory pointed to by Z0, Z0 will have a value of 100 so points to D100 & Z1 will have a value of 120 so points to D120. It then compares the two registers with each other & if the same then sets a bit corresponding to the registers it checked (first time if true will set M100), then it increments the pointers (Z0 & Z1) loops back then repeats the process with the next set of registers untill the for instruction reaches 7. Then the bits corresponding to the compares are anded so if all 7 are on (all registers compare for equal) then a bit is energised indicating the data is valid. Note in the two pictures first one shows compare, second shows a bar code is not true in two registers.

Compare With Same Data.png Compare With different Data.png
 
Multiple bar code readers on 232 is not practicable, 232 is point to point, connecting multiple TX data lines from more than one point will corrupt the data, you will need RS422 or 485 so that the TX/RX lines have a Non state.
You will also need to send addresses from each bar code reader so that the FX will know which one has sent the data.
It depends on what software i.e. GX Developer, GXWorks etc. you are using as the later IDE's allow you to configure the communication cards without ladder programming.

Yeah i know so, for that reason i have to add module master N-410 from Keyence to receive data from multiple barcode via RS 485 built in port. With the help from N-410 software named Auto ID, i can receive data read from one barcode reader to send to the host which is module FX2N-232IF. Then i will use instruction From/TO to write 232IF's buffer to D register.

The concept (file attached below) based on this picture but i replace the host computer by the FX2N-232IF module. Is that ok to do so? Thanks for your reply.

sample.png
 
I know nothing about the keyence Auto ID, however, I assume it will send the bar code plus the ID based on the port the bar code is plugged into for example: the message may be 01,123454678 maybe the ID is the first chars separated by some character like comma, semi colon etc. so there should not be a problem, however not knowing how the system will send the data i.e. you have one sensor & 3 bar code readers, does this mean that only one bar code exists, what happens if all three try to transmit at the same time so many questions, do you need to send requests to the 410 to get the data.
scenarios: on box detection assume all three bar coders read data how is that sent from the 410, one long string with the 3 reads, some may be false reads i.e. no read etc.
Regarding the send receive modes, if you do not need to send commands to the 410 then it can be set up so any data on the 232 port will be read into it's buffer, you just need to check this buffer (well the register containing the number of bytes received every scan of the PLC & work on valid data & clear the buffers or at least the register that tells you number of chars received.
 
I know nothing about the keyence Auto ID, however, I assume it will send the bar code plus the ID based on the port the bar code is plugged into for example: the message may be 01,123454678 maybe the ID is the first chars separated by some character like comma, semi colon etc. so there should not be a problem, however not knowing how the system will send the data i.e. you have one sensor & 3 bar code readers, does this mean that only one bar code exists, what happens if all three try to transmit at the same time so many questions, do you need to send requests to the 410 to get the data.
scenarios: on box detection assume all three bar coders read data how is that sent from the 410, one long string with the 3 reads, some may be false reads i.e. no read etc.
Regarding the send receive modes, if you do not need to send commands to the 410 then it can be set up so any data on the 232 port will be read into it's buffer, you just need to check this buffer (well the register containing the number of bytes received every scan of the PLC & work on valid data & clear the buffers or at least the register that tells you number of chars received.

Thank you for your reply again.
 

Similar Topics

I've worked on one Mitsubishi PLC in the past 40 years. Now, it looks like I get to tackle another one...using GX-WORKS3-C1 software which I...
Replies
3
Views
952
I have been asked to work on a Mitsubishi Melsec FX2N-80MR PLC but have no experience with Mitsubishi at all. The hope is to get online to find...
Replies
4
Views
1,341
Hi all IÂ’ve never worked with Mitsubishi PLCÂ’s or software, but a customer at our branch has requested the PLC program for future...
Replies
0
Views
784
Hi all IÂ’ve never worked with Mitsubishi PLCÂ’s or software, but a customer at our branch has requested the PLC program for future...
Replies
8
Views
1,637
Dear all, I have a FX2N-20MR chinese semi-clon of a Mitsubishi PLC. It has only a serial DB9 port that cannot be removed or exchanged (which is...
Replies
5
Views
2,084
Back
Top Bottom