Square one with 5i25+7i76

More
08 Apr 2017 15:41 #91051 by rotwang
First post, greetings to all.
Let's start with the first dumb question (I'm sure there'll be many more to come)
Setup is 5i25+single 7i76, I've used mesaflash to verify that the 5i25_7i76x2 bitfile is loaded, and after downloading mesa5i25.zip,
I now have the matching pin and xml files. I'm not convinced that pncconf is talking sense to me however.
I've figured out that I need field power on TB1, do I also need to supply power to TB3 pins 21/22 and 23/24 and should this be field power voltage?

Depending on the answer to that, I will investigate further (and no doubt ask more question)
Roger

Please Log in or Create an account to join the conversation.

More
08 Apr 2017 16:59 #91057 by tommylight
You should supply power only to TB1, TB3 is for other RS422 devices.

Please Log in or Create an account to join the conversation.

More
12 Apr 2017 10:22 #91231 by andypugh
Replied by andypugh on topic Square one with 5i25+7i76
Here is how I like to check the working of a Mesa card system. It just tests that everything is working independently of the test of the system. It is a HAL session run from the command line.
Open a terminal window and type
halrun
loadrt hostmot2
loadrt hm2_pci
show pin
exit

You should get a long list of HAL pins related to the 5i25. You should also get a lot of pins related to the 7i76 GPIO, if that is all connected, powered and working. These pins are likely to be of the form hm2_5i25.0.7i76.0.1.gpio......

If that all works then you can be confident that the hardware is set up correctly.

Note that PnCConf doesn't even need the hardware to be present to create a config.

In PnCConf you will probably not want to do anything at all with the 5i25 GPIO pins, look in other tabs for the 7i76 GPIO.

Please Log in or Create an account to join the conversation.

More
12 Apr 2017 11:55 #91239 by rotwang
Replied by rotwang on topic Square one with 5i25+7i76
Sorry, interrupt from real life has kept me away for a couple of days.
pncconf seems willing to assign all sorts of things to pins, including "digital input 0 thru 3" and "digital output 0 thru 3" which I don't find documented anywhere, but it absolutely will not set mode=2 in the output hal file. I have to edit it in every time. Is this a known problem with pncconf, or what am I not doing?
Roger

Please Log in or Create an account to join the conversation.

More
12 Apr 2017 13:08 #91244 by andypugh
Replied by andypugh on topic Square one with 5i25+7i76

Sorry, interrupt from real life has kept me away for a couple of days.
pncconf seems willing to assign all sorts of things to pins, including "digital input 0 thru 3" and "digital output 0 thru 3" which I don't find documented anywhere,


Those are inputs/outputs from G-code:
linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m62-m65

but it absolutely will not set mode=2 in the output hal file. I have to edit it in every time. Is this a known problem with pncconf, or what am I not doing?
Roger


I think it is a missing feature in PnCConf. The underlying achitecture of the config too pre-dates the smart-serial cards. when they arrived they really complicated matters.

Please Log in or Create an account to join the conversation.

More
12 Apr 2017 13:48 #91247 by rotwang
Replied by rotwang on topic Square one with 5i25+7i76
PnCConf is smart enough to that you have to tell it to use mode=2 for the 7i76 (I can't get to the machine at the moment, but it's in the setup) and it then allows allocating mode=2 things like the two sets of mpg inputs.
it just seems to forget to write it out to the hal file, and if you forget to edit it back in then linuxcnc starts puking error messages about undefined pins. So maybe it's a simple fix in the source of PnCConf, but I'm surprised nobody seems to have noticed it or mentioned it before now.
Thanks for the pointer to the m-code docs, another little piece begins to make sense.
So tonight I dive a little deeper down the rabbit hole.
Roger

Please Log in or Create an account to join the conversation.

More
12 Apr 2017 17:53 #91262 by rotwang
Replied by rotwang on topic Square one with 5i25+7i76
Getting somewhere. Quick trawl through pncconf code (/usr/bin/pncconf) seems to show that it knows about different modes (0,1,2) for 7i76 cards and does the necessary when presenting the options, then right towards the end of the file, when it is preparing the hm2_pci config= line it seems to only test for mode=1.
I could be wrong here, python isn't really my thing, and the author knows more about it's internals than I ever will (or want to) but maybe thats enough information to get somebody wiser than I looking.
If it's what I think it is, then the fix should be two or three lines.
Roger

Please Log in or Create an account to join the conversation.

More
12 Apr 2017 22:23 - 12 Apr 2017 22:28 #91271 by andypugh
Replied by andypugh on topic Square one with 5i25+7i76
Try editing your version of pncconf.py to look like this, and let me know if it works.
            if self.d.mesa0_numof_sserialports:
                for i in range(1,_PD._NUM_CHANNELS+1):
                    if i <= self.d.mesa0_numof_sserialchannels:
                        for j in ("123456789#"):
                            if ("m"+j) in self.d["mesa0sserial0_%dsubboard"% (i-1)]:
                                temp = temp + j
                                break
                        if j == "#":
                            temp = temp + "0"
                    else:
                        temp = temp + "x"
                ssconfig0 = " sserial_port_0=%s"% temp

If it does, I will push it as a fix.

(I don't actually know where you found a place to set the 7i76 mode, which is why I haven't actually tested it, but it seemed to work with a fictional 7i84)
Last edit: 12 Apr 2017 22:28 by andypugh.

Please Log in or Create an account to join the conversation.

More
13 Apr 2017 10:37 #91292 by rotwang
Replied by rotwang on topic Square one with 5i25+7i76
Setting mode 2 for the 7i76 was the easy bit, you do need a 7i76 attached to the 5i25, then fire up pncconf and click through to the MESA CARD 0 screen, second from bottom in left hand column, "7i76 Mode x I/O Card" (where x may be 0,1,2) click on the down arrow box and you can set the mode for the 7i76.

Now I'm off to make a backup of pncconf.py and try your patch.
Roger

Please Log in or Create an account to join the conversation.

More
13 Apr 2017 11:10 - 13 Apr 2017 11:13 #91294 by rotwang
Replied by rotwang on topic Square one with 5i25+7i76
That appears to work!
Here is the diff between pncconf.bak (the original) and the edited pncconf
5471,5475c5471,5476
<                         # if m1 in the name then it needs mode 1
<                         if "m1" in self.d["mesa0sserial0_%dsubboard"% (i-1)]:
<                             temp = temp + "1"
<                         else:
<                             temp = temp + "0"
---
> 			for j in ("123456789#"):
>                 	    if ("m"+j) in self.d["mesa0sserial0_%dsubboard"% (i-1)]:
>                     	        temp = temp + j
> 				break
>                 	if j =="#":
>                     	        temp = temp + "0"
Subject to further checks that seems to fix this problem, Now we go a little further down the rabbit hole.
Roger
P.S.
Localising this problem wasn't down to advanced voodoo debugging techniques, it was more a matter of once I had found how to set mode=2 for the 7i76 all the option boxes made sense, I could set all the things I expected to be able to set and everything seemed o.k. except that pncconf wouldn't write the correct line containing the mode 2.
SO I had a "what if" moment and checked whether it was actually writing it out to the hal file ..... and lo and behold it seems it wasn't.
Score one for dumb luck.
Last edit: 13 Apr 2017 11:13 by rotwang. Reason: just spotted indenting was getting mangled (curse you Python)
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.085 seconds
Powered by Kunena Forum