Famous_Fella

MrPLC Member
  • Content count

    35
  • Joined

  • Last visited

Everything posted by Famous_Fella

  1. Hi, I am trying to convert a variable of REAL data type to DWORD. I 've tried using Real_To_Dword function which works fine if the real number is integer but when the real is decimal the function rounds the decimal number to INT first (I ve also read it in the instruction manual so no surprise here). I 've also tried experimenting with the function CopyRealToDWORD but again the outcome was not what I expected. Is there another way to convert decimal real numbers to DWORD without losing the decimal portion?
  2. Hello, As the title says, I use an array (1-6) of real to store some values which I want to display on my HMI. I have also created an HMI variable of datatype Single(6) and mapped it successfully to the controller array variable but the HMI array variable doesn't get populated with values. I can confirm that the original array of the controller gets filled with the data I want, but they never get transfered to the HMI. What am I missing?
  3. NA mapped variable not populated

    Thanks for your help. The syntax was ok, the build works fine on both HMI and PLC but the array was refusing to populate. I finally did a trick that I came up with by total luck a few months ago: I made a pseudo change to the PLC ladder code and this forced an automatic variable re-mapping. this fixed my problem. I then reverted the change back
  4. Hi, In my HMI project I use a subroutine triggered by a button. All it does is check if certain variables are triggered and if the condition is met I use the showpage function to call a popup page.  Because of the update interval between PLC and HMI to 100msec the condition inside the subroutine is not always met although the PLC has completed the job behind the scene. Is there a way to implement a "wait until strategy" instead of the straight "IF...END_IF" I am using now ?  
  5. NX1P2 - Convert REAL to DWORD

    It appears that when sending a set_attribute command to the FANUC controller via explicit messaging you must also inform it of the data type you send. 0x6C was the answer for me. Thanks a lot Chelton.
  6. NX1P2 - Convert REAL to DWORD

    Hi, If I change the PLC data type of the array to DWORD, reading a register from the FANUC controller with the value -150 is translated as "C316 0000" in my PLC DWORD variable. Setting my variables to any kind of INTEGER does't extract anything from the robot.
  7. NX1P2 - Convert REAL to DWORD

    It is Ethernet IP
  8. NX1P2 - Convert REAL to DWORD

    If I try to send the number 2 as real data type the robot register reports the value 1.07584e+09. Reading and saving REAL numbers from robot to PLC REAL data types works just fine. Sending a real number though produces this.  
  9. NX1P2 - Convert REAL to DWORD

    Hi, Thanks for the replies. I am extracting real values from FANUC Robot Registers using the explicit messaging. Then, through the HMI I manipulate those values and use explicit messaging again to send them back to the robot controller using CIPUCMMSend function but unfortonately the ServiceDat containing the value to be transfered to the robot may only be a DWORD.
  10. Copy array element to member of a structure

    Thanks a lot for your help. I thought it was prohibited to use MOVE for Array data type so I didnt even try it. It works as intended.
  11. Hello, In my ladder program I have 7 different arrays (containing REAL values) all members of a structure and I wish to extract certain values from the arrays and put them on another structure consisting of REAL values (not arrays). Which is the best way to do that ? I tried AryMove command but I get an error "Conversion from REAL to ANY_ELEMENTARY[], ENUM[], STRUCT[] is impossible. To get a better understanding of my structures and arrays here is an example: Struct wheel_data Global variable SWheel of wheel_data rad[1...10] of real, vary[1...10] of real, varx[1...10] of real struct. 2 wheel Global variable Wheel1, .... , wheel10 of wheel rad REAL, vary REAL, varx REAL what I wish to do is to copy Swheel.rad[1]  to wheel1.rad,  Swheel.vary[1] to wheel1.vary, Swheel.varx[1] to wheel1.varx 2nd structure Swheel.rad[2]  to wheel2.rad,  Swheel.vary[2] to wheel2.vary, Swheel.varx[2] to wheel2.varx until I fill all 10 wheel structure instances with values Thanks in advance.
  12. NX1P2- explicit messaging to FANUC Robot

    Concerning that matter, the issue was that for sending messages both the set and get messages were sharing the same UCMMSend instance name, and accounting the fact that the RPI values are set really high on my system, the PLC was sending a write message and before it would get a response it was trying to send another message (my Main Task's scan time is 2ms) with the same instance name producing conflicts. So to anyone who will try to use explicit messaging extensively to communicate with a FANUC robot, people check your RPI values set from both PLC AND Robot. Every single minute I invest more on this project I realize that for the combined setup of a robot and a PLC to work together eficiently you really need to be half an OMRON half a FANUC expert with a Master's degree in Computer Networks.
  13. Hello, I am a beginner in PLC world trying to find my way through LADDER programming, ST, protocols etc etc and I am slowly getting the hang on it but now I have come accross a troublesome implementation. We have 3 Robotic Cells in my plant each of them consisting of a Fanuc robot communicating via Ethernet IP protocol to NX1P2 PLC controller. The setup of communications is implemented and working as intended but I want to use explicit messaging to manipulate certain Robot Position Registers, Registers and string Registers. I have the needed Fanuc documentation and Omron documentation but I am a little lost. Are there any guidelines I could use to start ?
  14. NX1P2- explicit messaging to FANUC Robot

    Concerning the project so far: I managed to use Set_Attribute_single service to manipulate 1 Numeric Register on the Robot and Get_Attribute_block service to read 6 Blocks of numeric registers each block containing 6 numeric registers. Now here comes my question: I use one POU with 6 rungs, each rung consisting of the CIPUCMMSend command for each block to be read. I use Get100msclk command on each rung to force each message every 100ms and update the values of each block. Is this an efficient way? Is it wise to send 6 messages indefinetely every 100 ms ? Would you advice on using a switch to turn the UCMMSend on and off ? Also, concerning configuration of Ethernet IP the RPI set from the originator was left on default of 50ms. The RPI on the Target (robot) was left on 35ms (default) all this from the integrator that installed the machine. Problem is I use LAN network to connect to the machine but the machine runs behind a VPN so I am unable to reconfigure the basic Ethernet IP using CX Network Configurator (because the PLC runs on an address of 192.168.150.1 but I use 192.168.0.164 provided by the NAT of the VPN router to connect). Is there any solution to reconfigure the entire Ethernet IP of the machine?   EDIT:  connecting locally using a Laptop is not  an option for the time being    
  15. NX1P2- explicit messaging to FANUC Robot

    UPDATE I found the reason why this happened. Reason is, I currently use 2 CIP messages, 1 to read 1 to write on separate POUs, but I used the same global variable passed on the RespServiceDat parameter of both instances. Changing the variable passed to internal on the first message corrected my problem.
  16. NX1P2- explicit messaging to FANUC Robot

    I could obviously try and move the values of ResDat array to the SWheel.Z_variance array AFTER the message but I am curious to know why it doesnt work like this. Again this a CIPUCMMSend function but with service Get_Attribute_Block
  17. NX1P2- explicit messaging to FANUC Robot

    this code setup doesnt fill the array
  18. NX1P2- explicit messaging to FANUC Robot

    this code setup works as intended as you can see from the watch tab
  19. NX1P2- explicit messaging to FANUC Robot

    So moving on, on the project and after successfully using Explicit Message function to write a single Numeric Register I moved on to the next request which is to read a BLOCK of registers and store them to an array. Again, after following FANUC's documentation for the correct setting of the message parameters I managed to read the block of registers I needed and here comes the problem: I need 4 separate blocks of registers to be stored in 4 separate arrays. To give you an idea of the project, the robot has 6 stations each station using a grinding wheel and for every wheel there are parameters like diameter, increment amount, skip increment/no of pieces, y dimension variance. So what seemed like a good idea was to create a structure (I called it SWheel) consisting of 4 arrays, then proceed to make a global variable of Data Type Swheel and using 4 separate messages extract each block and pass each array to the Response data recieved. My problem is this: If I pass, for example, SWheel.yVariance to the RespServiceDat parameter of the CIPUCMMSend function the array is not populated with values. If I pass another array created outside of structure in the global variables it gets populated as intended. Both arrays are of the same type (ARRAY[1..7] of REAL).   What am I missing?
  20. NX1P2- explicit messaging to FANUC Robot

    I really appreciate your time and effort! I spoke countless of hours with FANUC and OMRON and they couldn't guide me through setting it up. And when I set it up they couldn't propose any solutions to my problem. So much for "technical supports" and "customer care".
  21. NX1P2- explicit messaging to FANUC Robot

    YES !!!!! ServiceDat must be sent as DWORD ! Everything works flawlessly now !!!! Thank you very much for your help ! Greately appreciated !  
  22. NX1P2- explicit messaging to FANUC Robot

    It seems like the problem is what I send. If I change data type of ServiceDat to DWORD the UCMMSEND function executes successfully  
  23. NX1P2- explicit messaging to FANUC Robot

    Yes! It reads Register 13 with value 20 !!!!!!!!  Thanks a lot ! I am so happy ! I was starting to loose all hope.
  24. NX1P2- explicit messaging to FANUC Robot

    No. In translated the error based on the table of errors provided in NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506). Based on FANUC documentation the errors returned can be Undefined Attribute (0x14) Returned when the Register requested does not exist. Unsupported Service (0x08) Returned when the requested service is unsupported. Undefined Class Instance (0x05) Returned when the requested instance number is unsupported. No 09. Now I also made some tests. The robot controller supports 250 Numeric Registers INT or REAL data type based on the value I send. In the attached photos I am using Class 0x6B Instance 0x01 Attribute 0x95 Service 0x10 Value 1000 to  Register R[144] = 1000. I changed InstanceID to 2 which is unsupported and the system returned 05 fault as expected and documented from fanuc. I then changed Attribute to a number outside the supported range of 0-250 and The message was sent (nothing changed in the controller registers though) with all the parameters correct though I still get 09 error which is not documented by fanuc.