greetings 

In my python program pncconf I am programming a test panel for the mesa cards.
it consists of a pyvcp panel to display/ interact with a hostmot2 driven mesa 
board.
this is currently the 5i20 using the 8_4 bitfile.
The problem I'm having is if i use the hal command 'waitusr'
The watchdog bites. 
I have tried (on the command line ) not using the waitusr command
and the watchdog does not bite.
Anything obvious I have missed?
here is the python code section:

 self.halrun = halrun = os.popen("cd %(panelname)s\nhalrun -sf > /dev/null"% 
{'panelname':panelname,}, "w" )   
        halrun.write("loadrt threads period1=200000 name1=fast fp1=0 
period2=1000000 name2=slow\n")
        halrun.write("loadrt hostmot2\n")
        halrun.write("""loadrt hm2_pci config="firmware=hm2-trunk/%s/%s.BIT 
num_encoders=%d num_pwmgens=%d num_stepgens=%d"\n"""
         % (board, self.data.mesa_firmware, self.data.numof_mesa_encodergens,
            self.data.numof_mesa_pwmgens, self.data.numof_mesa_stepgens ))
        halrun.write("addf hm2_%s.0.read slow\n"% board)
        halrun.write("addf hm2_%s.0.write slow\n"% board)
        halrun.write("addf hm2_%s.0.pet_watchdog fast\n"% board)
       
        #halrun.write("setp hm2_%s.0.watchdog.timeout_ns 10000000\n"% board)
        halrun.write("loadusr -Wn m5i20test pyvcp -c m5i20test %(panel)s\n" 
%{'panel':"m5i20panel.xml",})
        halrun.write("loadusr halmeter\n")
        halrun.write("loadusr halmeter\n")
        for connector in (2,3,4):
           for pin in range(0,24):
                pinv = 'm5i20c%(con)dpin%(num)dinv' % {'con':connector ,'num': 
pin}
                ptype = 'm5i20c%(con)dpin%(num)dtype' % {'con':connector 
,'num': pin}
                pintype = self.data[ptype]
                if  pintype in (1,2):
                    
                    truepinnum = (connector-2)*24+ pin
                    halrun.write("setp m5i20test.led.%d.disable true\n"% 
truepinnum )
                    halrun.write("setp m5i20test.button.%d.disable false\n"% 
truepinnum )
                    halrun.write("setp hm2_%s.0.gpio.%03d.is_output true\n"% 
(board,truepinnum ))
                    halrun.write("net red_out%d hm2_%s.0.gpio.%03d.out 
m5i20test.button.%d\n"% (truepinnum,board,truepinnum,truepinnum))
                elif pintype == 0:
                  
                    truepinnum = (connector-2)*24+ pin
                    halrun.write("setp m5i20test.button.%d.disable true\n"% 
truepinnum )
                    halrun.write("setp m5i20test.led.%d.disable false\n"% 
truepinnum )
                    halrun.write("net blue_in%d hm2_%s.0.gpio.%03d.in 
m5i20test.led.%d\n"% (truepinnum,board,truepinnum,truepinnum))
                else: print "error"
        halrun.write("start\n")
        #halrun.write("setp hm2_%s.0.watchdog.has_bit false\n"% board)
        halrun.write("waitusr m5i20test\n"); halrun.flush()
        halrun.close()

_________________________________________________________________
Internet Explorer 8 helps keep your personal info safe.
http://go.microsoft.com/?linkid=9655581
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to