Stephen Wille Padnos wrote:
> Jon Elson wrote:
> 
> 
>>[snip]
>>
>>What you say is true for the USC and UPC boards, but the PPMC 
>>has some more flexibility to it.  It has master and slave DIO 
>>boards, for instance, and while the UPC/USC has SSR 8 hardwired 
>>to the estop FF, all 8 SSRs are completely under software 
>>control on the PPMC's DIO board.  So, the E-stop chain and 
>>e-stop FF on the master board controls all DIO boards (and 
>>DAC's, too) in the system.  All 8 SSRs on each DIO board are 
>>completely under software control except when in E-stop, when 
>>they are all forced off by the master DIO.
>> 
>>
> 
> Ah - ok.  I assumed that it was the same as the USC/UPC, reinforced by 
> Stuart saying that the manual said so :)
> 
> 
>>I gather that the hal_ppmc.c driver logic is overriding SSR8 on 
>>all boards, it should only do that on the master board.
>> 
>>
> 
> I don't think the driver overrides anything like that.  It could, but I 
> don't know.  I didn't look at the driver code before responding.
Here's the pertinent code :

static void write_PPMC_digouts(slot_data_t *slot)
{
     int b;
     unsigned char outdata, mask;

     outdata = 0x00;
     mask = 0x01;
     /* assemble output byte from 8 source variables */
     for (b = 0; b < 8; b++) {
        /* get the data, add to output byte */
        if ((*(slot->digout[b].data)) && (!slot->digout[b].invert)) {
            outdata |= mask;
        }
        if ((!*(slot->digout[b].data)) && (slot->digout[b].invert)) {
            outdata |= mask;
        }
        mask <<= 1;
     }
     /* write it to the hardware (cache) */
     slot->wr_buf[DIO_DOUTA] = outdata;
     if (slot->digout[8].data != NULL) {  // no estop funct on 
slave boards - hal pin doesn't exist
       outdata = 0;  // now process estop bit
       if ((*(slot->digout[8].data)) && (!slot->digout[8].invert)) {
        outdata =1;
       }
       if ((!*(slot->digout[8].data)) && (slot->digout[8].invert)) {
        outdata |= 1;
       }
       slot->wr_buf[DIO_ESTOP_OUT] = outdata;
     }
     else slot->wr_buf[DIO_ESTOP_OUT] = 2;  // force 2 to set 
additional boards to slave
}

Now, what the HECK does that second stanza beginning with

        if (slot->digout[8].data != NULL)

do?  It looks like it senses if the board being addressed is the 
master DIO because the slaves shouldn't have a HAL pin for 
Estop.  And, then it goes and writes the E-stop status to the 
Estop bit.  That all looks right.  This bit #8 (counting from 
zero) is only functional on the master board.  The code in the 
first stanza just copies the 8 digital out bits to the cache, 
with no special attention.  Whatever is written to 
ppmc.0.dout.07.out should be sent to SSR8 of that DIO board.

I don't have enough hardware here right now to do any testing on 
this (only have one DIO board, and no blank boards).  But, 
Stuart, you might do some debugging with Halshow to make sure 
that the desired true/false is getting to these hal pins.
I don't see anything in the driver code that would interfere 
with that.  I will get the blank boards ordered and make up a 
DIO board so I can test it, but that will take a while.

Jon

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to