PYVCP Standalone Hostmort2?

More
03 Dec 2019 22:13 #151907 by DaOne
I am trying to create a standalone panel to debug with. I unable to get it working by using the standard hall configurations for hostmot2.

even using "loadrt hostmot2" in the hal file gives me "using posix real time hostmot2 already exists"

without it I am not showing any one the pins in halmeter.

Can anone tell me how I get the pins to show up for hostmot2 devices in standalone pyvcp?

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

More
03 Dec 2019 23:10 #151916 by PCW
Replied by PCW on topic PYVCP Standalone Hostmort2?
Normally you would just

halcmd: loadrt hostmot2
halcmd: loadrt hm2_pci (or hm2_eth etc)

and you will get all your hostmot2 hal pins created

If you get a complaint that hostmot2 is already loaded, it could be that you are already running LinuxCNC or you have had a previous halcmd session that did no unload the driver properly.

Sometimes you can recover from this situation with

halrun -U

but not always...

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

More
04 Dec 2019 00:23 #151923 by DaOne
Replied by DaOne on topic PYVCP Standalone Hostmort2?
I got the pins to show up. was a typo. I cant get them to read or write (update). Adding a servo thread to a standalone pyvcp gives me errors. What would I add to the hall file to read and write to these pins? I am using 7i77, 7i71, 7i70.

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

More
04 Dec 2019 00:45 #151926 by PCW
Replied by PCW on topic PYVCP Standalone Hostmort2?
Heres a session with halcmd -f :
First just the commands:

halcmd: loadrt hostmot2
halcmd: loadrt hm2_eth board_ip=10.10.10.10
halcmd: loadrt threads
halcmd: addf hm2_7i97.0.read thread1
halcmd: addf hm2_7i97.0.write thread1
halcmd: start
halcmd: setp hm2_7i97.0.ssr.00.out-00 1
halcmd: getp hm2_7i97.0.watchdog.has_bit

And here are the commands and responses:

halcmd: loadrt hostmot2
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
halcmd: loadrt hm2_eth board_ip=10.10.10.10
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 10.10.10.10: Hardware address: 00:60:1b:17:00:ab
hm2_eth: discovered 7I97
hm2/hm2_7i97.0: Low Level init 0.15
hm2/hm2_7i97.0: Smart Serial Firmware Version 43
Board hm2_7i97.0.7ia0.0.0 Hardware Mode 0 = standard
Board hm2_7i97.0.7ia0.0.0 Software Mode 0 = standard
hm2/hm2_7i97.0: 51 I/O Pins used:
hm2/hm2_7i97.0: IO Pin 000 (TB3-04): PWMGen #0, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i97.0: IO Pin 001 (TB3-08): PWMGen #1, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i97.0: IO Pin 002 (TB3-12): PWMGen #2, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i97.0: IO Pin 003 (TB3-16): PWMGen #3, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i97.0: IO Pin 004 (TB3-20): PWMGen #4, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i97.0: IO Pin 005 (AN_ENA4): PWMGen #4, pin Not-Enable (Output)
hm2/hm2_7i97.0: IO Pin 006 (TB3-24): PWMGen #5, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i97.0: IO Pin 007 (AN_ENA5): PWMGen #5, pin Not-Enable (Output)
hm2/hm2_7i97.0: IO Pin 008 (AN-ENA0..3): PWMGen #0, pin Not-Enable (Output)
hm2/hm2_7i97.0: IO Pin 009 (TB1-01/TB1-09): Muxed Encoder #0, pin Muxed A (Input)
hm2/hm2_7i97.0: IO Pin 010 (TB1-04/TB1-12): Muxed Encoder #0, pin Muxed B (Input)
hm2/hm2_7i97.0: IO Pin 011 (TB1-07/TB1-15): Muxed Encoder #0, pin Muxed Index (Input)
hm2/hm2_7i97.0: IO Pin 012 (TB1-17/TB2-01): Muxed Encoder #1, pin Muxed A (Input)
hm2/hm2_7i97.0: IO Pin 013 (TB1-20/TB2-04): Muxed Encoder #1, pin Muxed B (Input)
hm2/hm2_7i97.0: IO Pin 014 (TB1-23/TB2-07): Muxed Encoder #1, pin Muxed Index (Input)
hm2/hm2_7i97.0: IO Pin 015 (TB2-09/TB2-17): Muxed Encoder #2, pin Muxed A (Input)
hm2/hm2_7i97.0: IO Pin 016 (TB2-12/TB2-20): Muxed Encoder #2, pin Muxed B (Input)
hm2/hm2_7i97.0: IO Pin 017 (TB2-15/TB2-23): Muxed Encoder #2, pin Muxed Index (Input)
hm2/hm2_7i97.0: IO Pin 018 (Internal EncMux): Muxed Encoder Select #0, pin Mux Select 0 (Output)
hm2/hm2_7i97.0: IO Pin 019 (TB5-13/TB5-14): SSR #0, pin Out-00 (Output)
hm2/hm2_7i97.0: IO Pin 020 (TB5-15/TB5-16): SSR #0, pin Out-01 (Output)
hm2/hm2_7i97.0: IO Pin 021 (TB5-17/TB5-18): SSR #0, pin Out-02 (Output)
hm2/hm2_7i97.0: IO Pin 022 (TB5-19/TB5-20): SSR #0, pin Out-03 (Output)
hm2/hm2_7i97.0: IO Pin 023 (TB5-21/TB5-22): SSR #0, pin Out-04 (Output)
hm2/hm2_7i97.0: IO Pin 024 (TB5-23/TB5-24): SSR #0, pin Out-05 (Output)
hm2/hm2_7i97.0: IO Pin 025 (Internal InMux0): SSR #0, pin AC Ref (Output)
hm2/hm2_7i97.0: IO Pin 026 (Internal InMux1): InMux Input Mux #0, pin addr0 (Output)
hm2/hm2_7i97.0: IO Pin 027 (Internal InMux2): InMux Input Mux #0, pin addr1 (Output)
hm2/hm2_7i97.0: IO Pin 028 (Internal InMux3): InMux Input Mux #0, pin addr2 (Output)
hm2/hm2_7i97.0: IO Pin 029 (Internal InMuxData): InMux Input Mux #0, pin addr3 (Output)
hm2/hm2_7i97.0: IO Pin 030 (TB4-15/TB4-16): InMux Input Mux #0, pin muxdata (Input)
hm2/hm2_7i97.0: IO Pin 031 (TB4-17/TB4-18): Smart Serial Interface #0, pin rx0 (Input)
hm2/hm2_7i97.0: IO Pin 032 (TB4-17/TB4-18): Smart Serial Interface #0, pin tx0 (Output)
hm2/hm2_7i97.0: IO Pin 033 (P1-01): Smart Serial Interface #0, pin txen0 (Output)
hm2/hm2_7i97.0: IO Pin 034 (P1-02): IOPort
hm2/hm2_7i97.0: IO Pin 035 (P1-03): IOPort
hm2/hm2_7i97.0: IO Pin 036 (P1-04): IOPort
hm2/hm2_7i97.0: IO Pin 037 (P1-05): IOPort
hm2/hm2_7i97.0: IO Pin 038 (P1-06): IOPort
hm2/hm2_7i97.0: IO Pin 039 (P1-07): IOPort
hm2/hm2_7i97.0: IO Pin 040 (P1-08): IOPort
hm2/hm2_7i97.0: IO Pin 041 (P1-09): IOPort
hm2/hm2_7i97.0: IO Pin 042 (P1-11): IOPort
hm2/hm2_7i97.0: IO Pin 043 (P1-13): IOPort
hm2/hm2_7i97.0: IO Pin 044 (P1-15): IOPort
hm2/hm2_7i97.0: IO Pin 045 (P1-17): IOPort
hm2/hm2_7i97.0: IO Pin 046 (P1-19): IOPort
hm2/hm2_7i97.0: IO Pin 047 (P1-21): IOPort
hm2/hm2_7i97.0: IO Pin 048 (P1-23): IOPort
hm2/hm2_7i97.0: IO Pin 049 (P1-25): IOPort
hm2/hm2_7i97.0: registered
halcmd: loadrt threads
halcmd: addf hm2_7i97.0.read thread1
halcmd: addf hm2_7i97.0.write thread1
halcmd: start
halcmd: setp hm2_7i97.0.ssr.00.out-00 1
halcmd: getp hm2_7i97.0.watchdog.has_bit
FALSE

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

More
04 Dec 2019 01:20 #151930 by DaOne
Replied by DaOne on topic PYVCP Standalone Hostmort2?
This works as is but when I uncomment the line "addf hm2_7i77.0.read t1" it force closes.

Still trying to figure out how to bring up a terminal window to debug as well so I can figue out whats causing the error.


loadusr pyvcp -c kitamura_test.xml

loadrt threads name1=t1 period1=100000 name2=t2 period2=1000000000

loadrt hostmot2
loadrt hm2_pci config=" num_encoders=6 num_pwmgens=0 num_stepgens=0" 
setp    hm2_5i25.0.watchdog.timeout_ns 5000000

# addf hm2_7i77.0.read t1
# addf hm2_7i77.0.write t1






start

loadusr halmeter

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

More
04 Dec 2019 01:23 - 04 Dec 2019 01:26 #151931 by PCW
Replied by PCW on topic PYVCP Standalone Hostmort2?
it should be hm2_5i25....

I would just do his is a terminal window with halcmd -f
rather that a edit load bail loop
Last edit: 04 Dec 2019 01:26 by PCW.

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

More
04 Dec 2019 01:24 #151932 by DaOne
Replied by DaOne on topic PYVCP Standalone Hostmort2?
Here are my files so you can see what I am trying to do.

File Attachment:

File Name: kitamura_test.tar
File Size:180 KB
Attachments:

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

More
04 Dec 2019 01:27 #151933 by PCW
Replied by PCW on topic PYVCP Standalone Hostmort2?
Doing this first with halcmd is about 10 times easier
(because of command history, command line editing and smart completion)

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

More
04 Dec 2019 01:29 #151934 by DaOne
Replied by DaOne on topic PYVCP Standalone Hostmort2?
hm2_5i25 was the issue... Thank you so much!

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

Time to create page: 0.093 seconds
Powered by Kunena Forum