BenJones

MrPLC Member
  • Content count

    108
  • Joined

  • Last visited

Everything posted by BenJones

  1. Hello, I'm pretty new to PLC programming and haven't set up a MODBUS protocol before. I have read all the manuals and downloaded the FB's from the Beijer website. I've connected the slave and have been trying to get comms for 2 weeks without much luck. Today I had the red "Send" light flashing on the 485 card and error message 211 which is as far as I've got. Cant even believe I got the light flashg to be honest. All I need to do is read data from a slave (kWh's etc) but I'm not sure the best way to go about programmingit it. I'm trying to use the ModbusFX3uMASTERADP_MB_CH1 FB at the moment but not totally convinced how it works. I've gone into Parameter / PLC and set up PLC system(2) for CH1 with 485 protocol etc but not sure if I need 8 bit, Even etc. I dont even know if I need to set this ? (It doesn't say in the slave manual if its ODD / EVEN/ 8bit etc, so I'm a bit lost) : http://uk.rs-online.com/web/search/searchB...t&R=0531226 http://docs-europe.electrocomponents.com/w...66b80da29db.pdf Ive set up the protocol with MB_192_8E1 which I believe makes it 19200 baud rate. Not quite understanding the addressing or command codes. My boss wont pay for any training for me (he's from Yorkshire), so I've spent hours reading the manuals and trying to work it out. Any help would be very useful and thanks in advance. Cheers, Ben
  2. Mitsubish FX3u

    Hello all, I'm totally new to PLC's and PLC programming. I thought it wouldn't be hard to program in ladder logic but it seems realtively complicated when using Mitubishi GX IEC Developer as one has to move things from specific memory and data registers rather than just saying ' if X > Y then turn on Z'. So, we have chosen an FX3u and FX3u-4AD-ADP analogue input cards. I can turn on and off a digital outputs from digital inputs, but can not read from analog inputs and turn on a digital outputs from the analog input at present. I have connected the analog inputs to sensors and am using them to read 0-10 volts. I wish to turn on a digital output when the sensor gives 7 volts or more on the analog input. I wish to program in ladder and I have a library of function blocks but I'm not sure what to input into the blocks ('S' and 'd' for example). I have the manuals and I believe I have to use M8001 to set it to volts rather than mA. Then I need to use a MOV function block and a CMP (compare) function block to compare something is greater than something else, eg, if >7v turn on Y1. It all seems rather complicated and programming is not my forte. I'm sure that when I do it once it will all sink in but getting to that point ins the hard bit. Could anyone help with maybe an example bit of code.
  3. Hello, Does anyone know if there is a way to perform a rolling average function using a special function block in IEC Developer ? I know that there are function blocks using Allen Bradley which can perform this function but can't find one with Mitsubishi. If I were to manually program this I'd need to make an array and then use a pointer and this would be hard for myself to program. I would use this function to monitor machine performance over time and it would give me an average over time. Any fluctuation to this average and I would see a change in machine behaviour which could possible mean that something is failing. Another function which could possibly work is an 'exponentialsmoothing ' fuction. I'm also not sure if there is a function block which can do this. Another way Thanks for any help, Ben
  4. Hi, I am using a function block 'IntScale' so that I can scale the analogue inputs from the FX4AD_ADP analogue input cards. I have 16 inputs and wish to scale all differently. If I use the IntScale FB this works but I have copied and pasted it 16 times in the program and this takes up a lot of memory. Is there a way to keep CALLing the FB so that I can input different values each time ? I guess I would need to MOVE each input and output to a seperate memory address ? Is there an easier way than this without taking up much memory ? I'm new to programming and not sure how to do this. Many thanks in advance, Ben
  5. Hello All, This is my first post in the Siemens part of this web forum. I have used a Mitsu FX PLC before but new with the Siemens S7-300. I am using a CPU314C-2PN-DP which has 4 integrated/onboard high speed inputs (channels 0,1,2&3). I am using these to read in a frequency from a water flow meter where 2-20 L/min corresponds to 20-225 hz. I'm struggling a little with getting them to work. I have found the S7-300 CPU 31xC: Technological functions manual and also an example program. I've also found the FB here : https://support.automation.siemens.com/WW/llisapi.dll?func=cslib.csinfo〈=en&objid=18475558&caller=view I have also found the sample example here : https://support.automation.siemens.com/WW/llisapi.dll?func=cslib.csinfo&objid=9837059&nodeid0=33519671&load=content&subtype=133100&switchLang;9837059;2.x=34&switchLang;9837059;2.y=4〈=en&siteid=cseus&aktprim=0&objaction=csview&extranet=standard&viewreg=WW I have attached the example to this post that I'm particularly interested in. I am using TIA portal V11 and V12. I have tried to migrate it from V5.4 to TIA V11 or V12 but I get an error message. Could someone please try and migrate it for me? Also, if anyone has used this FB before could they help explain how I wire the flow meter as I'm a little confused. It mentions in the manual but I'm still not sure. The direction is only one way and I'm just reading in a sqaure wave (0-24VDC) Many thanks in advance for any help, Ben Cnt_en.zip
  6. I'm having difficulty presenting a 32 bit number with exponent on my SCADA screen (E1101). I am reading the 32 bit number into 2 x D registers after reading the data from a kwh meter. I can read the data from the kwh meter device (via Modbus RTU). I am using IEC Developer. The parameter I wish to read is 'current' (Iph1). The number is represented as 32 bit unsigned number (of Type T5) please see attachement. The 24 least significant bits are a binary unsigned value and the 8 most significant bits are the decade exponent. First question : Is there an easy way to read/view this 32 bit number with an FX3u and E1101 (maybe using float with exponent or 32 bit unsigned or something) ? Second question : Do I have to use some more complicated method to read the data ? If so, I was thinking I must have to separate the most significant byte (which is the exponent) from the 32 bit number. Then I'd need to use a roll left function to roll by 8 bits and then shift function to shift by 24 bits right. Bloody complicated ! This would represent the binary number as 00000000 XXXXXXXX XXXXXXXX XXXXXXXX where X is the binary value. I could then multiply the binary number and the exponent. There must surely be an easy way to do this or do I have to use the more convoluted mathematical method ? any help is appreciated. Thanks, Ben data type.bmp
  7. Reading and presenting 32 bit number with Exp.

    Ok thanks guys. I don't think there is any easier way to do it. It's ok though, I've finished off the program to read in the number now (the long way!). If you do come accross the same problem in the future then the code I attached will work. Thanks for your comments and help, Ben ps. Is there any way to mark this post as 'completed/finished' or shall I just leave it ?
  8. Reading and presenting 32 bit number with Exp.

    Hi ! It seems very strange that the manufacturer (Areva) presents the data in this format ! I have done some programming (took me ages) to try and read the number by splitting the data into the upper 8 bits and the lower 24 bits, so I now have the signed exponent and the mantissa, but I don't know how to put this as one number and display it on the HMI (E1101). Been trying to read this number and put it on the HMI for about three weeks now. Crazy ! I've attached the Areva kWh meter manual as well as the programming which I have done (in IEC Developer). The Data type is under 'Data Types' in the manual on page 27. The modbus addresses which I'd like to display the values of, are 36-41 on page 16. (I can read from the addresses no problem). There surely is an easy way to do this because why would Aveva make there data so hard for a plc to read from their kWh meter ? Any help is much appreciated. Thanks, Ben AREVA M231 MANUAL.pdf MODBUS_READ_CURRENT_backup_file_change _extension_to_pcd.pdf
  9. Reading and presenting 32 bit number with Exp.

    Hi, thank you for your continued help. I'm still having problems. I think the problem is as follows : Please look at the 2 attachments. The PLC reads a floating point number as : Mantissa : 23 bits (b0-b22) Exponent : 8 bits (b23-b30) sign : 1 bit (b31) The modbus data type is read by the PLC from the kWh meter as follows : Mantissa : 24 bits (b0-b23) Exponent including sign : 8 bits (b24-b31) Does this mean that when the plc tries to interpret this as a floating point number it will not do it correctly because the bit order is different ?
  10. Reading and presenting 32 bit number with Exp.

    Hi Kaare, I can get the number shown in the OP no problem with 'FLOAT WITH EXP' but I don't think it's the correct number. I don't think it has converted it to decimal, I think it has stayed in binary with exponent. I may be wrong just a bit confused. Looking at the example from the manual it says that 123456 x 10-3 is stored as hex FD01 E240. When I convert FD01 E240 in the PLC I get -1.0790 to the power of 37 and I think this is base 2 binary and not base 10 decimal (surely the number I should get is 123456 with exponent -3. I downloaded an excel spreadsheet tool which converts to precision floating point number. I get the same number as the spreadsheet tool -1.0790 to the power of 37, when inserting FD01 E240 but is this base 2 ? If so then I think I need to convert this (somehow) to decimal !? ieeefloats.xls
  11. Reading and presenting 32 bit number with Exp.

    Thank you for your help ! Kaare your method did work. I now have the hexadecimal number FD01 E240 in binary floating point format ( -1.079032... x 2 ^ 37). I think I need to now convert this base 2 number (binary) into base 10 number (decimal). Is there an easy way to do this ? I've looked through the programming manual and searched through all the function blocks but can't see an easy way to do this. I used the DEBCD scientific notation function but this didn't put the number into decimal format it just put -1079 into D and 34 into D+1 ie representing the mantissa and exponent in the same base (-1079 x 2^34) Thanks again, Ben
  12. Hello All, Has anyone had the problem where data log files have stopped being attached to an email when using the E1101 HMI (using an SMTP server). I've set up time channels to send me a daily email with a data log attached. For the first month the emails worked correctly and attached the data log. The data log getting bigger on a daily basis up to 1MB before its full an then it just over rights a days worth of data and stays the same size. This has now stopped working and I don't know why. I now get an email on a daily basis but it stops attaching the log file after a day or two. The data log gets to about 20kB after a day or two and I still get the email but it doesn't have the data log attached ! Does anyone have any idea why this might happen ? It's really puzzling me. I've checked that the SMTP server is not stopping large file sizes (which it's not). I can set time channel to send me three or four emails before the log file stops getting attached so I figured it must be something to do with the file size. I've set up the data logging to save 20160 samples (7 days at a sample rate of 1 sample every 30 seconds). The max limit I've also set to 20160. Has anyone else had this problem ? Many thanks for any ideas. Ben
  13. Hello all. Is there any way of automatically sending data on a daily basis (say 9am every morning) from a remote E1101 HMI via email back to the office ? At the moment I have to remotely log in to a pc which is connected to the E1101 and use FTP client (with HMI tools) to copy files from the HMI via serial cable to the pc and then copy them back up to the office with Windows remote desktop. I'm pretty sure there is no way of doing this automatically but I thought I'd ask the question in case anyone knows a solution. Thanks, Ben
  14. E1101 Errors

    If anyone gets the FILESIZE error I know how to fix it. You have to compress the bitmaps which the program uses. If any of the bitmaps within the project are ticked on the 'stretch' function (within static object properties) this needs to be un-ticked as re-sizing the bitmaps takes a lot of memory. If you look at the 'symbols folder it shows you the bitmap sizes.
  15. E1101 Errors

    Hello,m has anyone got any ideas of how to rectify the FILESIZE problem. I can no longer upload my file to the E1101 HMI. The file itself is not too large in size. I don't know what the problem is so any help would be useful. Thanks, Ben
  16. E1101 Errors

    Hello, I've just had these errors as well and consequently can't upload a program. I tried to change the alarm size to 5kb and 10kb but to no avail. (see attached) Do you think I may have to add some external memory ? After uploading from Edesigner it now says my file is 3500kB. Is this too big ? Many thanks, Ben
  17. Sycon multi drop protocol (SMDP)

    Hello, A company (Cryomech) supply us with a cryocooler and this has a controller made by a company (Sycon). I wish to connect to the controller to my PLC (Fx3u) using a serial card (RS485_ADP). I'm also using IEC developer. The protocol in question (SMDP) is not well known and they haven't got around to re-programming it with an industrial standard protocol like modbus or profibus. This of course makes things more tricky to program and I can assure you that I'm NOT the best programmer in the world ! The Mitsubishi guy say I'll have to program my own driver using the RS2 non-protocol. I have got no idea how to do this. I've got RS2 function block to work before (with Beijers modbus solution pack) using Modbus RTU but the SMDP uses ASCII. I don't know to program ASCII or even know if this is possible with the Mitsubishi stuff. Any pointers in the right direction would be useful. I've attached the protocol reference manual. Thanks, Ben data_dictionary.pdf Sycon Multi Drop Protocol II.pdf
  18. N : N Networking

    Ok, sure, we'll probably be sticking with the FX then I think. Seems to do what is says on the tin and should be ok for the next project too.
  19. N : N Networking

    Hello all, Just a quick question. We are about to start a new project here and there are many ways we could approach it. I was trying to think of the best way to lay out the network and how I would program the PLC's. Please refer to attachment. We have a main building and 2 containers. Once a year we have to do maintenance on a container and only have half a day, so we will have a third container and swap it with either container 1 or 2 (which ever needs swapping). Because of the short time we have to swap the container I was thinking of the easiest method of connecting the Main Master PLC to the two slave PLC's (as little cables as possible). I thought the best way would be to use 3 PLC's in total and N : N networking between the PLC's, so there is just one RS485 per container. I could then send all the data via the container PLC to the Master PLC in the main building. Can I ask, does this seem to be a sensible way to do it ? And, is N : N networking really hard and complex to program, or should it be quite straight forward ? Many thanks, Ben
  20. N : N Networking

    Hi ! Yes, I already thought of this ! After I've decided the best way of setting up the network I shall think of this further. I want to get to a point where the program for all 3 containers is the same, and then I just hard wire a digital input which then switches the slave numbers around so the PLC slave number in the third container can either be 1 or 2 depending on which is being swapped out. Thanks for the link on the quick disconnect cables. This was also something I was thinking about. It may save costs as well as extra programming with the slave PLC's. If I were to go down this route, may be a more powerful main PLC would be a good idea, the Q - series for example. Cheers, Ben
  21. N : N Networking

    Ok, thanks Crossbow ! . I shall think further about the amount of information I need to transfer
  22. N : N Networking

    Hi ! Thanks for the advice. Kaare - I'm using GX IEC Developer v7.03. I think I understand what you mean. I've attached a picture to try and decripbe this. The only problem with this set up is that I'd have to change the slave numbers when replacing a container to suit either container 1 or 2. However, if I can do it this way it'd be easier to program I think. I have not yet set up a channel as a slave, but I have looked at the function block to use in the 'solution pack'. It looks like the function block only sets the slave number (station number) and the comm's setup (baud rate etc), so I was wondering how I read the information from the container PLC's so that I can then read it into the main PLC. Is the the modbus addressing for the slave PLC's just the slave PLC registers or is special mapping required to certain registers ? Ben
  23. FX3U & IEC DEVELOPER

    Thanks ! I got it working Ben
  24. FX3U & IEC DEVELOPER

    Hello guys, Hope everyone is well. I'm about to set up an FX3U as I've shown (Attachment 1). (Qu.1) Is it possible to use one channel only as both a master and slave or do I need 2 channels : one to use as a master and one to use as a slave ? (Qu.2) To setup 2 channels I shall do the following. I will be using a CNV_BD card as an expansion port which shouldn't allocate a channel. Then 2 x RS485 ADP cards which will be allocated as CH1 and CH2. I wish to use channel 1 as a Modbus Master and channel 2 also as a Modbus Master. I realise that you cannot allocate both cards (CH1 and CH2) for use with modbus protocol (attachment 2), because if b0 in 8401 and 8421 are both high then priority will be taken with CH1 and the PLC cannot read from CH2. I think that there is a 'work around' for this as Kaare mentioned before and mitsubishi have programmedi a program for this in their modbus soluton pack ? I see that Beijer / Mitsubishi have programmed ADP Modbus function blocks for Ch1 and CH2, so I would think you can use them together, right ? I have the 'FX modBUS solution pack' from Beijer (Attachment 3), but I don't know which are the most appropriate function blocks to use for CH1 and CH2. Can anyone shed some light on this ? Do I use : Channel1 (ADP): ModbusFX3UMaster_V100.zip Channel2 (ADP): ModbusFX3UMasterADP_MB_V100.zip ? If so, which function blocks / programs should I use from each that will work ? Remember, both channels should read modbus protocol. Do I use : ModbusFX3UMasterRS2_CH1 for channel 1, and ModbusFX3UMasterRS2_CH2 for channel 2, or ModbusFX3UMasterRS2_CH1 for channel 1, and ModbusFX3UMasterADP_CH2 for channel 2, or What will work ? Also, please, what does ADP mean and what does RS2 mean ? Kaare, you said previously, that : "Mitsubishi/Beijer have written the Modbus protocol in pure code so that both channels can be used at the same time (one of the cards is configured using the "built-in" Modbus protocol, and the other card uses the programmed Modbus protocol)." Which is which ? Many thanks for any help, Ben
  25. Hi ! Yes, got it to work ! Thank you, that is going to save me so much time logging in every day to copy the data lag file back ! Thank you for your help ! Bests, Ben