Posted 2 Oct 2008 DORLUX_MAT_PACK_V1.rar Help with file registers I have programmed mitsis for years and thought I knew pretty much all I ever needed to know. So last week I was called to a customer that had a machine that was misbehaving. This machine is a matress packer with a fx1n 40 and a 16 output extra module The hmi is a LENDHER (which I can find no information about) The company makes beds and this machine wraps and seals the mattresses with polythene. The mattress come down a conveyor and the packer straightens it, wraps polythene around it heat seals one side then moves it down to seal the other sides. The straightening action is timed to give a value to tell the part 2 sealer how far out to move the 2nd sealing bars. (the matresses are all different sizes) It has worked ok for a few years - now sometimes the second sealers dont get the information from the first and so do not move and then miss sealing the polythene. Now the program (which I have attached below) is either very badly written, well it is anyway - or I am missing something huge in my education. of course - no such thing as comments or drawings - the only things marked are what I have added. I just couldnt follow the flow of this program so I have brought it to my office to play with so I dont mess anything up I have put the program in a spare fx1n40 I use for just these things. So firstly, file registers - I have never ever used them but my understanding is you set aside some memory for the file registers and the values in them stay with the program - not just the plc. you access them by using BMOVE to put them in normal D registers But apart from this program that jumps around all over using STL programming in a most uncoventional way The BMOV instuctions are baffling me. For a start (if you look at the program) the bmove is moving 8 registers at a time always in to start address d100 - ------------ - - - d101 d102 dont exist anywhere in the program (maybe they are used with the hmi that I cant get into) in the character string (when looking at memory) there are things like alarms written which dictate the values in the file registers. - but almost the entire memory has been allocated as file registers but only a few seem to be used. I dont think this is the problem with the machine - but I do need to understand what is happening. I wrote a test program with file registers and the strangest things happened The only way I could get values into them was by using device test I then saved the program and got an extra file registers option I cleared the plc memory and reloaded the program (including the file registers) and the values I had put in were there. But I then tried to change them by looking at memory devices and I couldnt (well I could but they didnt show in the program) also, if I wrote words in the character strings at the end - the whole registers changed value but not in the program??????? Can anyone shed any light on the use of file registers... :( Share this post Link to post Share on other sites
Posted 3 Oct 2008 You seem to have understood everything quite well. What bit are you stuck on? This may be saying what you already know but : From the FX2 'handy' programming manual: -------------------------------------------------------------------------------------------------------- Consider them 'read only' changed only by a program download. ------------------------------------------------------------------------------------------------------- Don't any of the following strings appear on the HMI? ERROR EN D3/D4 ERROR ON PHASE2 INITIALIZATION ERROR ON S3 NAPAKA VAR STRAN WORKING READY MACHINE STOPPED DOOR OPENED EMERGENCY STOP The Bmov moves the above strings to D100-D108. D102... do exist in the program implicitly in the BMOV. They are not used anywhere else in the program as they are for the use of the HMI only. ------------------------------------------------------------------------------------------------------- The file allocation could be a typo? Share this post Link to post Share on other sites
Posted 6 Oct 2008 Thank you veganic for your reply (sorry for the delay in mine) It helped that you confirmed what I thought - and in this case the file registers are all for the hmi warnings etc. I am still not easy with file registers though (not this program but in general) They dont seem to play straight! :) Like; - there is no instruction to put values in file registers - so it seems you have to POKE each one in by hand. Thats ok - you can go to device memory and put them in by hand. But, if you want real words in the character string (as a mnumonic to help you know what the registers are for) the values in the registers change and as far as I can tell, they are either in hex or 32 bit???? after using character strings and bmov-ing these values into ordinary registers - they dont work correctly using math manipulation. (they do work correctly without using the character string - but in the program I am using they have character strings) I am only interested in teaching myself all about file registers and have done some extensive testing of them over the weekend with some totally unexpected results. At the moment - although I can now see some merits of file registers, I dare not use them in anything I do in the future without a solid grasp of them and, it would seem I am not alone stumbling around in the dark here - by the amount of views and d/l's of the program. Maybe we all need to find some definitive answers here :) 1 person likes this Share this post Link to post Share on other sites
Posted 6 Oct 2008 To be honest I've never found a use for them. They just seem to be D registers made difficult. 1 person likes this Share this post Link to post Share on other sites
Posted 8 Oct 2008 Lol Veganic, and I, after much testing and playing and struggling etc have come to the same conclusion. Maybe their best use is for memory retention after a long power down, I dont know! (who programs with a thought that the machine might be unpowered for 6 months :) ) Share this post Link to post Share on other sites
Posted 8 Oct 2008 Since file registers can be stored on a memory card, another purpose of file registers is portability. If the CPU dies (which of course doesn't happen) the values in the R registers can be stored on the memory card with the program and simply moved into a replacement CPU. And their purpose is long term storage. Share this post Link to post Share on other sites