trm

MrPLC Member
  • Content count

    29
  • Joined

  • Last visited

Everything posted by trm

  1. Hi ! I have the following problem: I use a FX3U-16MR PLC with 2xFX3U-485ADP-MB + 1xFX3U-ENET GX Developer 7.01 and when i try to access data registers from 512 to 999 i get error AT COMPILATION: Error: F1028 Access to system addresses is denied Error: F0137 Illegal device used or symbol not valid I can configure them to be latch (by default) or non-latch. I can see them as available 0-7999 (actually 0-199 non-latch + 500-7679 latch) 0 - 199 non-latch (can be conf. to be latch) 500 - 1023 latch (can be conf. to be non-latch) 1024 - 7679 latch (latch only) I contact my local dealer and support , but they can't help me till Monday and also they use mostly GX Developer ;( And with GX Developer it works. Thank you in advance for your time and help.
  2. Accessing D512 - D999 in FX3U problem

    Hehe :) OK, no problem :D :P :) ps: you have PM.
  3. Accessing D512 - D999 in FX3U problem

    Yes that HELPED ! I knew there were system/reserved space of registers, but forgot where this is configured. Thank you a lot ... Tell me how can i send you a pack of beer hh and preferred brand :P :) :D
  4. Hi as for now i have never have the need to check a whole data reigster (i.e D?). I have used AND D100.3 for example And also ADD , SUB, DIV, MUL, MOV, BMOV, MOVP, AND=, OR=, etc instruction i have used with D? registers but how to do this if( REGD10 & 0x0203) ... LD D10 AND H0203 looks fine, but LD loads only _bit_devices like M,X,Y, etc ... :( I know it's a funny and maybe stupid question ,but .. here it is ...
  5. (newbie) isntruction question

    I know this, but FEND i have to add !?. So why it is telling me there is two FEND instruction.... Instantly it comes to my mind that the IDE adds and the FEND instruction automatically ;) :) ps: but what about the operational error i get :???
  6. (newbie) isntruction question

    Thank you a lot , my program now works as expected and looks the way i wanted :) :) Thank you all again ! Although the program works perfectly and gives correct results i have PLC error (when i check PLC Diagnostics) --- I have a suggestion that it is because of missing END but when i try to add END GX IEC Developer tell me "he" puts them , not I. And when I add FEND it tells me i can't add more than one and i have only one ;( Very odd , but most likely it is also something i have read but missed Have a nice day and "Happy coding" :-]]
  7. (newbie) isntruction question

    Yes ! If it doesn't i get error something like "label doesn't exists" or it was "no such label" ;) :) I rewrite my code to use FOR and i workaround this issue , but it's really strange. One more thing is that i need(ed) to use CALL in a FOR and as far as i know/understood from the documentation it is permissible( i mean allowed ;) ). But when i have this code: FOR TIMES CALL FUNCTION NEXT It compiles ok, but then when i run it on the PLC i get ERROR_LED ** btw: i now use a lot wand, wor, wxor function, so thank you for telling me for them , i somehow was missing them :) OFFTOPIC ** ii "hate" when this led goes on , it means ... "well we know you are frustrated cause our IDE and compiler didn't warn you, but hey it was not going to be so fun without such possible scenario: to have a 0 errors , 0 warning program , but crashing in the PLC :D , also we are happy you paid us so much so we can screw with you End of OFFTOPIC
  8. (newbie) isntruction question

    I have one strange problem , i have the following lines of code: LD M8022 CJ somewhere This code makes the PLC in state "dead". The error led on the PLC doesn't blink it is always on and there is no communication withthe PLC ideas ? Only way to make it work again is to turn power off and then turn it on. ps: if the code is LD M0 OUT M1 RST M0 CJ somewhere it works without errors I really want to say 'what the f***' ... :|
  9. I need to receive a request and then send a response through a RS485 (FX3U-485ADP-MB). I can send, i can receive and i can simultaneously receive and send, but when i try to first receive and then send it doesn't work .... ;( or at least not the way i want. Here is one of my code i think is closest to what i want LD M8000 OUT Y0 // just to see it's working MOV H1C81 D370 // at first i made it bit by bit, but then for more readable code i decided to be a hex value MOV D370 D8400 // write it to CH1 MOV K64 D11 // init. a variable which we will send as test ack LDI M8002 // when not first scan ANI M8402 // and all data has been sent or no data are sending right now RS2 D0 K0 D21 K10 K1 // start waiting to receive 10 bytes LD M8403 // check if received is complete BMOVP D21 D31 D8403 // if yes move data to another buffer (just for testing) MOVP K1 D10 // set D10 to 1 , which is used latter as byte count to send INV // invert it MOV K0 D10 // if M8403 was 1(data available so send response) , but after the INV it's 0 so the line is not executed and D10 = 1 -------------------\ // if M8403 was 0 (data not available so we have not to send response) and after the INV it's 1 so the line is executed D10 = 0 ---------- _this_algorithm_works_ ! LD M8403 // here i could use INV , but decided to be again LD M8403 for more readable code ;) nothing that the code is just for testing. RST M8403 // clear so we are ready for next reception (and this will happen after response is send) LDI M8002 // when not first tart ANI M8403 // and the data was received or no data was received AND> D10 H0 // and there is an value in D10 greater than 0, i.e send some bytes RS2 D11 D10 D0 K0 K1 // start waiting for send request ... to send 1 byte SET M8402 // send request I spent already around 4 or 5 hours in this stupid , easy issue ... i feel ridiculous. Thank you for all your help and time you spent on my problem in advance ! I really appreciate it !
  10. RS2 requeset then RS2 response

    But yet it's only a implementation of the modbus protocol , it doesn't handle the actual sending and receiving ;) where is my problem when i'm acting like slave (RTU Modbus). And i already have writen my own modbus implementation for Master (cause i use only few of the available Function Codes ;) ) But Thanks ! That's really a useful information ;) :)
  11. RS2 requeset then RS2 response

    I needed this request -> response as an optional feature ... , but ... as of now i have two working codes with such kind of 'behavior' (and not working very well). 1. receiving request and sending correct response many times before stopping :| [ i will not put the code , cause it's not worth ed ] 2. receiving 5-7 bytes and then sending one ... LD M8002 MOV K1 D10 MOV K65 D11 LD M8000 RS2 D11 D10 D21 K10 K1 LD M8403 SET M0 RST M8403 LDP M0 SET M8402 RST M0 -- The device i'm working on actualy it's going to be Serial RTU Modbus Master and Ethernet TCP Modbus Slave , but i wanted and my bosses wanted to be able to respond and to RTU Modbus requests on the rserial port(s) ... but it will have to be developed on a later stage ... Thank you for all your help and time spent ! I leave the subject open and when i have the time i will write here. Yet again i'm sure we are missing something small , not mentioned in the documentation , which i read not just serveral but many times - especially the part about RS2 communicaiton ! :( I think this is a stupid problem ... and some skilled PLC programmer will actually laugh at us , but i'm not worried about that, i'm worried about the time I/we spent for such easy task (or at least easy at first sight). Good Luck and have a nice weekend (it's 16 o'clock by me so i have 3 more hours of word day ;) :)) Bye.
  12. RS2 requeset then RS2 response

    I have test your code Dariusch, it does not send .. it receives the request ,but does not send ;) i have no time to debug it right now , but maybe next week I will develop this code: LD M8002 _initialization_ LD M8000 RS2 D11 K1 D21 K1 K1 LD M0 // flag send SET M8402 RST M0 // right after send request is set clear flag (the send request already have gone on it's way) LD M8403 // if we have received SET M1 // set receive flag _collect_data_ // move to _more_user_buffer (cause the buffer we have in the RS2 line we have dedicated to the communication which happens every scan ! :) RST M8403 // clear receive flag --- I will write to you as soon as it works right and give you the code ...
  13. RS2 requeset then RS2 response

    Hi ! Thanks ! Something very important i have realized yesterday ((but have forgotten today) when going back to home and thinking it through. And now it came back to me: Not the 'Send Request' must be constantly true , the RS2 instruction must be ! I.e you can have only one line RS2 and depending on M8402 it will send and receive or only receive ! LD M8002 MOV K65 D11 LD M8000 RS2 D11 K1 D21 K1 K1 LD M0 SET M8402 RST M0 LD M8403 RST M8403 Test it ... through Debug/Online Monitor change the value of M0 to 1 and it will SET M8402 then right away M0 goes 0 It receive every time and sends only when M0 is set :) :) I haven't implement it in my program exactly in this way, but from one hour and so i use only one (1) RS2 instruction and once i have succeeded to send per request ... playing with the M8402 only , how and when to be set .. nothing else and now i remember this , so after the launch break (cause here by me it's 12:51) i think i will finish it. After that i will test your program ! Thanks for you reply !!! btw: The treasure key is in the Pulse instructions and SET (not OUT instruction) ! :) :) !
  14. RS2 requeset then RS2 response

    Here is another code that does one request receive and then response send Now the question is what to add so it does it only one send per request. There are few options i can think of: 1. check M8403 , if 1 then we have receive complete = i.e bytes received so we process the request and send the response 2. check D8403 , if >0 then we have receive x number of bytes 3. check first buffer reg, i.e if RS2 D0 K0 D21 D20 K1 then D21 is the first buffer register and we check if it has changed or it has a value different than 0 , if yes then we have (new) request :) ---- I have tried all of this variant .. including using/making a flag (M0/M1/M2/M3/... etc) for the different states, but with no success so far ... And i know this is a very stupid and funny problem ! ;) :) LD M8002 //on first scan OUT Y0 //test output on MOV H1C81 D370 // CH1 config MOV D370 D8400 // init CH1 MOV K8 D20 // bytes count to be received MOV K3 D10 // bytes count that for sure will be send MOV H0102 D14 // just dummy bytes of data MOV H0304 D15 // same MOV H0506 D16 // same MOV H0708 D17 // same LD M8000 //non-stop working/receiving as there can be multiple requests from different clients RS2 D0 K0 D21 D20 K1 // send nothing , receive 8 bytes in D21-24 regs (cause 8bytes = 4 word) LD M8403 // if receive complete WAND H00FF D21 D31 // get lower byte WAND HFF00 D21 D32 // get high byte SWAP D32 // switch MSG, LSB so the reg represent the actual value (i.e 0x0900 is actualy 0x0009 -> decimal 9, because we receive in 8 bit mode but store in 16 bit registers D... ) MOV D23 D33 // copy value (this is due to the protocol i use RTU Modbus) SWAP D33 // FX3U-485ADP-MB sends in LITTLE ENDIAN for unknown reasons and i don't find a setting/bit to change that , so we have to switch MSB/LSB to send the high byte first ! :) LD= D31 H1 // if unit = 1 AND= D32 H3 // if function code = 3 OUT M0 // flag M0 is ON LD M0 // if flag for correct request is on MOV D31 D11 // full buffer (id) MOV D32 D12 // same (function code) MUL D33 H2 D13 // we have X words requested * 2 bytes each = x*2 (length of data frame) MOV D10 D30 // move constant byte count for send (id + fc + length = 3) ADD D13 D30 D30 // add the count of the date bytes = x * 2 (we already calculated this above) RS2 D11 D30 D0 K0 K1 // send from reg D11 , D30 count of registers , no receiving SET M8402 // send request to _SERIAL_MODULE_CH1 Thank you for your time ... bye for now ;) :) ps: GX simulator can not simulate serial communication / module ;( :(
  15. RS2 requeset then RS2 response

    Here it is ... I wrote the program in IL in GX IEC Developer 7.04 and then looking at it i wrote it in Ladder in GX Developer 8 So the attached file is a project for GX Developer and it is in Ladder ;) Thank you a lot for your time and answers ! :) request_response_v1.rar
  16. RS2 requeset then RS2 response

    GX IEC Developer 7.04 and FX3U plc. after few minutes i will upload the last code i wrote in ladder for GX Developer 8, which has to work , but again does not :( I have both GX IEC Developer , GX Developer ... and also GX Simulator 6 ...
  17. RS2 requeset then RS2 response

    I always write in IL , but sometimes use Ladder module ... If you want i can make the IL into Ladder and give it to you , but it has to happen later, cause now i'm on a deadline :|
  18. RS2 requeset then RS2 response

    Here is another one that has to work , but does not :( LD M8002 OUT Y0 MOV H1C81 D370 MOV D370 D8400 MOV K12 D10 MOV H0103 D11 MOV H0801 D12 MOV H0203 D13 MOV H0405 D14 MOV H0607 D15 MOV H0800 D16 SWAP D11 SWAP D12 SWAP D13 SWAP D14 SWAP D15 SWAP D16 LDI M8402 OUT M0 RS2 D0 K0 D20 K1 K1 LD M8403 OUT M1 MOV D20 D30 RST M8403 RS2 D11 D10 D0 K0 K1 OUT M2 SET M8402 M0 always stays 1 and M1,M2 always 0 I think at start M8002 = 1 => init of CH1, loading data regs with message, after that if M8402 = 0 then set M0 and set RS2 to receive after this when M8403 = 1 (i.e bytes are received) set M1 and mov the received byte into other buffer reset/clear M8403 (i.e = 0) set RS2 set M2 (it's just for checking/debugging) set M8402 for send Maybe after i clear M8403 with the RST instruction my accumulator becomes 0 ?
  19. (newbie) isntruction question

    Yes i had this in mind, but what if i need to apply some other logical/math action after it/later ? For example: D10 = 90F1 mask 8010 -> result 8010 and now i want D10 = 8010 so i can apply later new masks just for check or again to modify the D10 mask 1000 -> result 0000 ??? ----- I use it like this just for a simple check: LD M8000 AND= D10 H0203 as I wasn't sure if AND= needed control instruction ,but i think it doesn't, but just to be sure ... or i needed something like this in C: if( variable ) { ... } or if( variable != 0) { ... } which both means _if_variable_is_true ... LD<> D10 H0 or LD= D10 H0 INV which logically is the same The PLC is FX3U-16MR
  20. Hi ! 1. I read all pdfs about FX3U-ENET and as far as i understood i have to use the FROM/TO instructions to receive/send data. But i don't know the address of the special function module :? 2. Also i have another problem with initialization and configuration. I used the FX Configurato EN, but i want it to be from sequence program ! And i have the following problem: LD= U1\G27 H1 compiles fine, programs fine, runs fine with no error led on from the PLC, but when i check Diagnostics (from Debug menu) i have an operation error :| :? MOV U1\G28 K4M110 also compiles fine, programs fine, runs fine with no error led on from the PLC, but when i check Diagnostics i again have an operation error :( ---- The first( 1 ) point is more important to me. If you can help me i will be very happy Thank you in advance.
  21. FX3U-ENET send / recieve how

    Yep, i have the same sample/example code for TCP Modbus ;) without the FX3U-ENET configuration And they are using port 1248 for both send/receive :) I guess they are using port forward on the router or on the PC (like I will do) Thank you a lot for your help, the topic is finished/"closed". Now is left to make the TCP modbus implementation work :) Bye for now and again BIG THANKS TO ALL WHO helped me and take some of their time to write to me ! // i'm new to the PLC world so your support was crucial to me :P hh
  22. FX3U-ENET send / recieve how

    I can do a port forward from port TCP-X to TCP-502 :) Thanks for the info
  23. FX3U-ENET send / recieve how

    OK. I have done it At last ... Here is the test code: LD M8000 MOV U0\G1614 D100 MPS AND= D100 H1 MOV U0\G5760 D101 ADD D101 H1 D101 DIV D101 H2 D103 BMOV U0\G5761 D10 D103 MPP AND= D100 H8 INCP D102 LD= D100 H1 OUT M2 MOV H2 U0\G1614 LD M8000 MOV U0\G28 D300 LD M2 AND= U0\G1607 H5 OR M200 ANI M201 ANI M202 OUT M200 MPS MOV K49 D10 MOV K50 D11 MOV K51 D12 MOV K52 D13 MOVP H8 U0\G6784 BMOVP D10 U0\G6785 H4 MOVP H1 U0\G1615 MOV U0\G1615 D200 AND D200.2 OUT M201 MPP AND D200.3 OUT M202 And here is the FX3U-ENET config: FX3ENET_working_passive.rar
  24. FX3U-ENET send / recieve how

    I have this manual: JY997D18101 MODEL CODE: 09R716 Am ... well i don't see any problem to make the TCP Modbus function manually , also i have a sample code of TCP modbus software implementation , i.e no Ethernet init,conf or send/recieve 'functions'. Just TCP Modbus functions. (and they are in ladder for GX IEC Developer, which i'm using). Thank you yet again for your opinion and help. ;) :) ps: i'm programing in LIST/IL edit: I get FX3U-ENET error code 0054 :( and i can't understand what it means. Also i get COMM ERR and "Open processing abnormally completed". edit: check this ->
  25. FX3U-ENET send / recieve how

    I made the receiving work ! In the FX3U-ENET User's MANUAL there is a MISTAKE. The registers/BFM after 1602 are wrong. The Decimal values are wrong and the Hex are true, so i calculated Hex -> Dec and use it as U0\G_Dec_ and it works perfectly ! Now i will correct and the registers in my test sending program and will see what will happen :) :P :) I'm very happy, thank you for all your help so far ! ps: I really need to know if FX3U-ENET can not be used for TCP Modbus, it will be very strange and unlogical.