Jump to content
OMRON Forums

ACC59E and Power PMAC


bradp
 Share

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Whenever you want to go from a Turbo PMAC address to a Power PMAC address you can refer to this link http://forums.deltatau.com/showthread.php?tid=23 The ACC59E at the moment is detected as an IO gate. This means you can access it from the GateIO[] structure. The index to use is shown below in the table. The GateIO[] structure has a substructure DataReg[] from which you can read and set the data. Unfortunately we have two problems at the moment. First is that the GateIO[] does not show up in the intellisense in firmware after July 23 2008. You can still type it however and the substructures will show up. Second and more important is that the DataReg[] structure only works in 8-bit bytes which will not help you much for an ACC59E. This means it will be better to use M-variables for ACC59E. Based on the switch settings the table below will give you the starting address. [attachment=1321:name]
Link to comment
Share on other sites

Here is the excerpt from the ACC59E manual about the DAC outputs. The following is a list of suggested of M-Variables to access the appropriate DAC output registers for an Acc-59E with a base address of Y:$78c00: M8101->Y:$78c08,0,12 ;DAC #1 M8102->Y:$78c09,0,12 ;DAC #2 M8103->Y:$78c0a,0,12 ;DAC #3 M8104->Y:$78c0b,0,12 ;DAC #4 M8105->Y:$78c08,12,12 ;DAC #5 M8106->Y:$78c09,12,12 ;DAC #6 M8107->Y:$78c0a,12,12 ;DAC #7 M8108->Y:$78c0b,12,12 ;DAC #8 The difference you have is the address setting. You have switch 3 OFF and from the address table this means the base address of ACC59E is $79C00. This will change the above to M8101->Y:$79c08,0,12 ;DAC #1 M8102->Y:$79c09,0,12 ;DAC #2 M8103->Y:$79c0a,0,12 ;DAC #3 M8104->Y:$79c0b,0,12 ;DAC #4 M8105->Y:$79c08,12,12 ;DAC #5 M8106->Y:$79c09,12,12 ;DAC #6 M8107->Y:$79c0a,12,12 ;DAC #7 M8108->Y:$79c0b,12,12 ;DAC #8 The next difference is you have a Power PMAC. From the table I sent you this means the base address is $A08000. Next you need to find what an offset of 8 ($79c00 to $79c08) means in terms of a Power PMAC address. The formula refered to in the previous e-mail located in the forum was simplified. A more complete idea follows. One warning is that the diference in the UMAC addresses must be less than 256 for this method to work. 1.) The method for translating a UMAC address for Power PMAC is as follows: First you must calculate your OFFSET. You do this by finding the difference between the desired UMAC_Address and the UMAC_Base address. If this offset is less than 8 then you can use it directly. If this offset is greater than or equal to 8 you must find out how many times 8 will go into that number and add 64 (0x40) for each of these times. Then add this to four times remainder to get the OFFSET. In equation form one way to write this is OFFSET = INT((UMAC_Address – UMAC_Base)/8)*64 + ((UMAC_Address – UMAC_Base)%8)*4 Note that % represents the modulo operator. Then apply one of the following equations If converting a Y Memory location PPMAC address = OFFSET + PPMAC Base If converting an X Memory location PPMAC address = 32 + OFFSET + PPMAC Base In this situation for ACC59E UMAC_Base is $79c00 PPMAC_Base is $A08000 Step 1: Calculate the OFFSET OFFSET = INT(($79c08 - $79c00)/8)*64 + (($79c08 - $79c00)%8)*4 OFFSET = 64 + 0 Step 2: Apply the equation for Y memory to get PPMAC Address = 64 + 0xA08000 PPMAC Address = 0xA08040 Remembering to include the additional 8-bit offset, this gives the following addresses M8101->u.io:$A08040.8.12 ;DAC #1 M8102->u.io:$A08044.8.12 ;DAC #2 M8103->u.io:$A08048.8.12 ;DAC #3 M8104->u.io:$A0804c.8.12 ;DAC #4 M8105->u.io:$A08040.20.12 ;DAC #5 M8106->u.io:$A08044.20.12 ;DAC #6 M8107->u.io:$A08048.20.12 ;DAC #7 M8108->u.io:$A0804c.20.12 ;DAC #8 The same exercise can be used for the analog inputs. The ACC59E manual has the following address. (It works so that when you write to the address it reports back the value at the same address) For bipolar signals: M1000->Y:$78C00,24 ;M-variable for Conversion Channel Select M1001->Y:$78C00,0,12,s ;M-variable for Read Data for channels 1 to 8 For unipolar signals: M1000->Y:$78c00,24 ;M-variable for Conversion Channel Select M1001->Y:$78c00,0,12,u ;M-variable for Read Data for channels 1 to 8 Converting to Power PMAC as above we get For bipolar signals: M1000->u.io:$A08000.8.24 ;M-variable for Conversion Channel Select M1001->s.io:$A08000.8.12 ;M-variable for Read Data for channels 1 to 8 For unipolar signals: M1000->u.io:$A08000.8.24 ;M-variable for Conversion Channel Select M1002->u.io:$A08000.8.12 ;M-variable for Read Data for channels 1 to 8 You will also need a PLC to convert this data and place it into some variables. The only thing that needs to modified from the example in the ACC59E is how the timers work. For this example, convert channels 4 and 2 as unipolar inputs and read channel 1 as bipolar in the PLC 10 program: OPEN PLC 10 . . . M1000=3; // convert channel 4 as unipolar p1=sys.time + 0.01; // get system time and add 10 msec While(p1>sys.time); // wait for time to expire P104=M1002; // P100 now contains converted chan. 4 data M1000=1; // convert channel 2 as unipolar p1=sys.time + 0.01; // get system time and add 10 msec While(p1>sys.time); // wait for time to expire P110=M1002; // P100 now contains converted chan. 10 dat M1000=8; // convert channels 1 as bipolar p1=sys.time + 0.01; // get system time and add 10 msec While(p1>sys.time); // wait for time to expire P101=M1001; // P101 now contains converted chan. 1 data . . CLOSE
Link to comment
Share on other sites

Power PMAC also allows you to use an automatic read method to get the ADC values. Using this method you do not need to have a PLC program running and do not need to make any M-variable definitions. To set this up follow the example below. // General Explanation // ADCDemux.enable = value between 0 - 16. Number of pairs of ADC's to convert. ADCDemux.enable = 1 converts ADCDemux.Address[0], ADCDemux.enable = 4 converts ADCDemux.Address[0..3], // ADCDemux.ConvertCode[n] = 0 converts ADC1 & ADC8, $00000100 ADC 2&9, $00000200 ADC 3&10, $00000300 ADC 4&11 for that address[n] structure // ADCDemux.Address[n] = Address of chip select used by the ACC card, $a0000 CS10,$b0000 CS12, $c0000 CS14, $d0000 CS16 for that address[n] structure // ADCDemux.ResultHigh[n] = ADC conversion result highest ADC of the conversion pair for that address[n] structure // ADCDemux.ResultLow[n] = ADC conversion result lowest ADC of the conversion pair for that address[n] structure // Setup Example for ACC59E with SW1=OFF SW2-4=ON ADCDemux.enable = 4; // convert 4 pairs or 8 ADCs ADCDemux.Address[0] = $B00000 // ACC59E base address set by address select switch ADCDemux.Address[1] = $B00000 // ACC59E base address set by address select switch ADCDemux.Address[2] = $B00000 // ACC59E base address set by address select switch ADCDemux.Address[3] = $B00000 // ACC59E base address set by address select switch ADCDemux.ConvertCode[0] = $000; // convert ADC's 1 & 8 from ADCDemux.Address[0] ADCDemux.ConvertCode[1] = $100; // convert ADC's 2 & 9 from ADCDemux.Address[1] ADCDemux.ConvertCode[2] = $200; // convert ADC's 3 & 10 from ADCDemux.Address[2] ADCDemux.ConvertCode[3] = $300; // convert ADC's 4 & 11 from ADCDemux.Address[3]
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...