Famous_Fella

MrPLC Member
  • Content count

    35
  • Joined

  • Last visited

Posts posted by Famous_Fella


  1. On 15/6/2020 at 4:09 PM, IO_Rack said:

    Is it possible your syntax is incorrect?

    Controller syntax is MyArray[1]

    HMI syntax is MyArray(1)

    Notice the brackets.

    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


  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. 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 ?

     


  4. 7 hours ago, chelton said:

    Is it possible to read the value out of the Fanuk controller as a dword rather than a real, to see what the format should be?

    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.


  5. 6 minutes ago, pcmccartney1 said:

    What is the protocol between the PLC and the Fanuc controller.  I ask be cause I doubt you are exchanging reals or floating point.  Rather it's probably all DINT and it's imbuement on each side to multiple and divide to move the decimal place and number of digits.

    It is Ethernet IP


  6. 22 minutes ago, Michael Walsh said:

    DWORD values do not have a decimal portion.  Real numbers are the way that you can express this type of number.....  You could multiply it first as a REAL and then convert.

    so, 

    100.342 x 1000 = 100342.0  Then convert:

    100342 would be the DINT version and if you do DWORD (DWORD is a somewhat generic format displayed as a hex number), its value would be:  187F6.

    I am not really sure why you would want to do this though.  What is it you are trying to do?

    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.


  7. 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?


  8. 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.


  9. On 26/3/2020 at 3:39 PM, Michael Walsh said:

    Good to hear.  Thanks for the update.  I was going to take a look at this today,  at first glance though it seemed like it should have worked.  I would not have been able to duplicate your issue (without the code anyway).

    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.


  10. 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

     

     


  11. 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?


  12. 14 hours ago, Michael Walsh said:

    That is what I was thinking when I suggested doing a read, I thought the data type might be incorrect.   Nice work!

    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".


  13. 55 minutes ago, Michael Walsh said:

    Try a read first.  Use all of this below, but Byte#16#0E for the service code:

    ReqPath.ClassID :=UINT#16#6B;
    ReqPath.InstanceID :=UINT#1; //1 is the same whether hex or decimal
    ReqPath.isAttributeID:=TRUE;
    ReqPath.AttributeID :=UINT#16#15;
    CIPUCMMSend_instance(
    Execute :=TRUE,
    RoutePath :='02\192.168.150.25',    //robot_ip
    TimeOut :=UINT#20,
    ServiceCode :=BYTE#16#10,
    RqPath :=ReqPath,
    ServiceDat := ServiceDataVariable, //Create a variable that is of the type that the data to write is. If 15 value is a UINT, make this a UINT and put 15 in it.
    Size :=UINT#1, //if only writing one value (15) then set this to 1.
    RespServiceDat:=ResDat);

     

    See if you get data in the ResDat.

    Yes! It reads Register 13 with value 20 !!!!!!!! 

    Thanks a lot ! I am so happy ! I was starting to loose all hope.


  14. 1 hour ago, Michael Walsh said:

    1C00 means that the ErrorIDEx will be a code that is stored there based on the remote node (that is the Fanuc Robot).  If you have looked in the Fanuc Manual and it said invalid Attribute, which is what I think you are saying, then try UINT#15 (as I mentioned in my initial response, I was unsure if the 15 was hex or decimal).  I provided the hex example above (UINT#16#15), so again, try UINT#15 (integer) for the attribute.

    1 hour ago, Michael Walsh said:

    1C00 means that the ErrorIDEx will be a code that is stored there based on the remote node (that is the Fanuc Robot).  If you have looked in the Fanuc Manual and it said invalid Attribute, which is what I think you are saying, then try UINT#15 (as I mentioned in my initial response, I was unsure if the 15 was hex or decimal).  I provided the hex example above (UINT#16#15), so again, try UINT#15 (integer) for the attribute.

    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.


  15. 19 hours ago, Michael Walsh said:

    Yes, monitor your response data for an error response from the robot (use the Watch Tab Page as discussed below to monitor).

    If something goes wrong with communications to the robot (setup incorrect, or some other issue, command does not get to robot or response does not get back), it is necessary to monitor the outputs of the function block.  Assign variables to the output pins (as shown below):

    UCMMSend.jpg.3890bb8d65fe717038e7a382acc

    You could just monitor the values right there in the ladder, or open the Watch Tab page:

    watchtabmenu.jpg.6b3610def1fc9dbceac6366

    and the window will be at the bottom of the screen.  Just add the variables to the window.  Be sure to enter local variables like this:  ProgramName.Variable Name.  You could also use this window to monitor your Response data.

    UPDATE:

    Thank you for your valuable help. I was able to to find the error but I dont really know how to overcome this. As the manual states any errors concerning the outcome of the function will be stored in ErrorIDEx variable which in my case returns 0900 0000 Invalid attribute value but there is also another variable called ErrorID which stores 1C00 which I guess I have to ignore for now,  as the cause of my failed message is the attribute value which I don't understand why as I have followed all the rules provided by FANUC's EIP Manual and vendor-specific list of services attributes etc etc