FX2N-20MT PLC (clone of Mitsubishi)

Your problem is you have no communications interface to talk to any sort of ADC, other than the same serial port you have for programming this thing.

You will be better off just buying another model that has built in analogs.
 
Impossible to buy another one, locally they charge too much and if I buy it abroad it takes many months to go through the local customs.

If my ADC produces a binary word: can the PLC read that serialized data using as few inputs as possible and then use that data in the program to make a decision (for example turn on an output)?
 
Here is the one my apprentice purchased from Amazon, it was delivered within 2 days The supplier is Keenso, however, I believe it was delivered from Amazon that is why it was in stock & short delivery. Although talking to my old apprentice he paid more than this so it must be on special offer

Industrial Control Board, FX3U-14MT Analog 6AD+2DA 24V 1A PLC Industrial Programmable Control Board Programmable Logic Controller Relay Output

Here is the link for amazon UK, depends where you are but this is cheap.
https://www.amazon.co.uk/Industrial...+FX3U-14MT&qid=1621231335&s=industrial&sr=1-6
It depends on the resolution you want for example a you have a maximum number of inputs of 8 then your resolution is only 255 so 0-10v will be 0-255 or 25 counts per volt not very accurate.
 
Last edited:
If you are only going to use this for learning then you do not really need any inputs/outputs or analogues to learn basics of coding only for real world applications like actually controlling actual peripherals.
Most programmers simulate the programs so do not actually use the real I/O. for example the pdf I posted, if you disabled the read analogue input and just used the variable that it would normally move the data to i.e. 0-4000 in the case of the FX2N, then you can write temporary code to simulate the analogue input going up & down using a timer to increment the variable.
So in effect white the logic & simulate the I/O with internal bits. I agree that being able to have things move in the real world is better but to learn the basics of programming the real I/O is not required.
Most programming IDE's for OLC's now have simulators built in, although some have some simple programming to simulate real I/O I still prefer to create my own I/O simulation even within the simulator. Certain function do not work i.e. simulation of special cards like analogues, motion or communications.
What I tend to do is create an input/output program which maps the inputs into internal bits and maps internal bits to the outputs, also include any analogue processing but not call this block(s), then use the mapped bits/words in the program, this way you also create a simulation program block, this simulates the I/O and analogues, when tested, remove the simulation blocks & re-instate the mapping to the real I/O.
 
Here is an example of simulating the analogue, note I have disabled the call to the analogue block and instead used a reciprocating timer to simulate it incrementing a value, I have limited it to a count of 3 so you can see the outputs come on in sequence it is just a simple trial to show how it works in reality the analogue raw value could be anywhere between 0-4000 (0-10v).

Less than.png Equal to.png Greater than.png
 

Attachments

  • Analog Sim.pdf
    68.9 KB · Views: 22
Thanks for the replies and code attached.

I am making a system for demostrating at a educational institute. After that I will probably continue learning using just the simulation.

I suppose I can convert the analog data from a sensor into a four bits BCD to have 10 different values (not very precise perhaps but it can do for me).
I imagine I can use 4 inputs to read that BCD data and then I can make the PLC to do something else (like turn on an output). How should be the code for that? Any better ideas?

As I coded a bit in some languages as Pascal, Assembler, C, etc, I imagine I can do something like this (but I am not sure so I am asking again here):
1) start a counter and a loop that will run until the counter equals 4 (for 4 bits for example)
2) put the value of a single input into memory position X
3) increment the memory position
4) increment the counter
I think for this I will need some delays or it will be too fast and I will need to callibrate the speed of data sent my ADC with the speed of the loop.
This is for you to get the idea, I am sure it needs a lot of improving.

I look forward for the replies. Thanks.
 
You don't need a counter, you can do the same by incrementing a variable of a word type, however, it's good practice to try all functions I do not tend to use counters just increment a variable on a pulse to reset you just move 0 to the variable.
Here is a couple of examples the first couple of lines are using some of the inputs as a binary code in this case X0 to X3 (4 bits) 0-15 in decimal are masked off so the other inputs do not interfere with it by Anding the X0-X7 (8 bits) with Hex 0F then only the lower nibble is passed to the variable D1 this allows the other inputs to be used direct in other code without interfering with the lower nibble value (Putting K4 as part of X0 means bits x0-7 K8 would be bits x0-15 it is a byte or word mask. The next rung just does a compare of the value to turn on an input.
The other two rungs are just a way of instead of using an analogue or in your case a bit pattern (analogue to digital conversion) you can simulate it by just using the variable where the analogue raw value would be copied to.
This could also be done with a counter just substitute the INC & DEC with a counter, however, Mitsubishi counters in FX are a little complicated, standard counters only count up you have to use the special counters for up/down which requires the setting of the direction flag (only if using GXDeveloper) if using GXWorks then there are built in functions in FBD.
 
Excellent, thanks! I will try that.


I forgot this reply in my previous message: It doesn't matter if I buy it in Amazon (as suggested) or at any other store or if I choose a fast shipping option. The problem here and now is that because of the pandemic the customs office is working with less people giving priority to medical items and that means it takes many months to get the parcels from them.



Any ideas of what integrated circuit/s I can use to make my ADC? (not smd please!). I suppose the smarter thing to do is to make an ADC for a 4-20mA analog sensor. However while I find an affordable and useful sensor to buy for my project I was wondering if I can use the K type thermocouple that comes with my UNI-T clamp meter. It needs to be something using quite standard and cheap electronic components so I have more chances of finding it at the local suppliers.

I think I will need some thyristors to make the outputs of the ADC to become 24V in order to connect it to the inputs of the PLC.
 
You won't need thyristors the inputs are 24v so transistors to amplify the signals will do. If you google Analog to digital converter circuits and select images there are plenty, however, most will be at least 8 bit & non SMD devices are difficult to obtain nowadays. The problems you will come across are getting the scaling right for say a 4-20ma or 0-10v input i.e. some form of amplifier or even a splitter to reduce the current/voltage, the simplest way to get either 4-20 or 0-10v is to buy a PT100 resistance probe & a head converter. or even just buy a TC to 4-20ma 0-10v converter. My apprentice purchased a PT100 & 0-10v head converter for about £10.00 and used that with the FX3U clone the output of the FX3U is also 0-10v but only low current, he fitted a power transistor & a few resistors to drive a 24v bulb, this was glued to the PT100 so effectively had a heating loop, there with my help he developed a PID loop so that he could control the temperature measured from the bulb.
 
Parky,


Could you please provide links to the items you are suggesting me to buy? I've been searching but I am not sure of exactly what I need. I see a lot of similar things.


Thanks
 
This is one of the simplest I could find however, it is 8 bit output, I have no idea what the voltage input is so you would probably have to put a variable resistor to adjust it, never tried this so it is just an idea, I know it's not the same but could you use a digital pot i.e. a single thumbwheel switch ideally a binary not BCD although you could convert it or just use one that goes from 0-9.
https://www.bing.com/images/search?...ctedIndex=0&FORM=IRPRST&ajaxhist=0&ajaxserp=0
 
Dear Parky,

Fortunately the local electronics shop has all the parts to build the second circuit (you mentioned in message #27). The english of the guy who wrote it is worst then mine so that plus me not being an expert in electronics makes it a bit difficult. Maybe you can re-write at least the part where it says how to do the adjustment & usage plus any other part you consider important? Do you think I will need that amplifier shown there as well?
I plan to use this ADC connected to a resistive car petrol level (I can check the range of ohms if you need me to).

Many thanks
Best Regards

Marcelo
 

Similar Topics

Hello Im very new here with PLC world, i just buyed from amazon a FX2N-20MT, which I believe its a mitsubitshi clon, Im using gxworks2. Well my...
Replies
10
Views
1,777
Hello everyone, I am currently facing a challenge while trying to connect two Weintek HMI units with a Mitsubishi FX2N PLC. When connecting a...
Replies
5
Views
458
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
918
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,276
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
764
Back
Top Bottom