I am a
- Rustacean
- Open Source and Free Software developer
- Professional embedded systems software developer
STEP-7 AWL/STL PLC simulator
Home Page: http://bues.ch/a/awlsim
License: Other
I am a
In STOP the GUI CPU-state widgets are not being updated. So there might be outdated information.
-> Update CPU-state widgets at least once after going into STOP.
I did not find this items in the todo list, but it would greatly simplify the work:
In the "Symbols" table in the "Symbol" column, you can make a hint for the names entered above, for example, as in the MS Excell tables, and in the "Data type" column, type auto-completion by the first letter entered.
Also, when editing the operand name in the FBD scheme, it would be nice to have a name hint from the "Symbols" tables.
If this is very difficult, then you can make the operand name be copied or pasted immediately with quotation marks or pound.
Also, I did not find how to enter constants besides creating a memory flag. In the examples there is "L # 65000" as far as I understand it passes a 32 bit variable, but how do I pass a boolean?
I am not sure what to do about these issues, I'd like to use the AWL file as is but it is from the 90's and I'm not sure what may have changed since then. I've attached screenshots and the original AWL file
For values above -1.0 and below 0.0 the instructions RND+ and RND- round incorrectly.
RND+:
For -1.0 < ACCU1 < 0.0:
Expected result: 0
Actual incorrect result: 1
RND-:
For -1.0 < ACCU1 < 0.0:
Expected result: -1
Actual incorrect result: 0
Online diagnosis is broken, if the sources are not re-downloaded and the runstate is not set to RUN again.
Fixed in 70ca568
Here's what I get:
cnc@linuxcnc:~/Desktop/awlsim-0.74.0$ python setup.py
WARNING: Could not build the CYTHON modules: Cython 2 not supported. Please use Cython 3.
Skipping build of CYTHON modules.
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
cnc@linuxcnc:~/Desktop/awlsim-0.74.0$
app dependencies were installed from the github zip
I also have the following report after an error running linuxcnc with the example files:
Error report created by /usr/lib/tcltk/linuxcnc/show_errors.tcl:
Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.8.0
Machine configuration directory is "/home/cnc/linuxcnc/configs/test_all_demo_files"
Machine configuration file is "test_all_demo_files.ini"
INIFILE=/home/cnc/linuxcnc/configs/test_all_demo_files/test_all_demo_files.ini
VERSION=1.1
PARAMETER_FILE=emc.var
TASK=milltask
HALUI=halui
DISPLAY=axis
COORDINATES=XYZ
KINEMATICS=trivkins coordinates=XYZ
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Found file(REL): ./linuxcnc-demo.hal
Found file(REL): ./awlsim.hal
Shutting down and cleaning up LinuxCNC...
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
Debug file information:
Note: Using POSIX realtime
Unexpected realtime delay on task 0 with period 20000
This Message will only display once per session.
Run the Latency Test and resolve before continuing.
./awlsim.hal:25: execv(awlsim-linuxcnc-hal): No such file or directory
./awlsim.hal:25: waitpid failed awlsim-linuxcnc-hal awlsim
./awlsim.hal:25: awlsim-linuxcnc-hal exited without becoming ready
3964
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime
-----------------------------------------------------------------------
Info report created by linuxcnc_info:
The file: /tmp/linuxcnc_info.txt
can be posted to a forum or a web site like:
http://pastebin.com
in order to provide information about the linuxcnc
system and configuration.
Date: Thu 10 Jun 2021 11:36:30 AM EDT
UTC Date: Thu 10 Jun 2021 03:36:30 PM UTC
this program: /usr/bin/linuxcnc_info
uptime: 11:36:30 up 1:03, 1 user, load average: 0.02, 0.04, 0.08
lsb_release -sa: Debian Debian GNU/Linux 10 (buster) 10 buster
which linuxcnc: /usr/bin/linuxcnc
pwd: /home/cnc/linuxcnc/configs/test_all_demo_files
USER: cnc
LOGNAME: cnc
HOME: /home/cnc
EDITOR:
VISUAL:
LANGUAGE:
TERM: dumb
COLORTERM:
DISPLAY: :0.0
DESKTOP: lightdm-xsession
display size: 800x600 pixels (211x158 millimeters)
PATH: /usr/bin:/home/cnc/linuxcnc/configs/test_all_demo_files/bin:/usr/bin:/home/cnc/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
uname items:
nodename -n: linuxcnc
kernel-name -s: Linux
kernel-vers -v: #1 SMP PREEMPT RT Debian 4.19.146-1 (2020-09-17)
machine -m: x86_64
processor -p: unknown
platform -i: unknown
oper system -o: GNU/Linux
/proc items:
cmdline: BOOT_IMAGE=/boot/vmlinuz-4.19.0-11-rt-amd64 root=UUID=9457fa4f-82b8-4c33-8384-2ef2f2f77780 ro initrd=/install/gtk/initrd.gz quiet
model name: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
cores: 1
cpu MHz: 3400.030
parport:
serial:
Versions:
gcc: gcc (Debian 8.3.0-6) 8.3.0
python: Python 2.7.16
git: git version 2.20.1
git commit: NA
tcl: 8.6
tk: 8.6
glade: not_in_PATH
glade-gtk2: not_in_PATH
linuxcnc_var all:
LINUXCNCVERSION: 2.8.0
LINUXCNC_AUX_GLADEVCP: /usr/share/linuxcnc/aux_gladevcp
LINUXCNC_AUX_EXAMPLES: /usr/share/linuxcnc/aux_examples
REALTIME: /etc/init.d/realtime
RTS: uspace
HALLIB_DIR: /usr/share/linuxcnc/hallib
dpkg -l "*linuxcnc*":
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===================-============-============-=====================================================================
un linuxcnc <none> <none> (no description available)
un linuxcnc-dev <none> <none> (no description available)
un linuxcnc-doc <none> <none> (no description available)
ii linuxcnc-doc-cn 1:2.8.0 all motion controller for CNC machines and robots (Chinese
ii linuxcnc-doc-en 1:2.8.0 all motion controller for CNC machines and robots (English documentation)
ii linuxcnc-doc-es 1:2.8.0 all controlador de movimiento para máquinas CNC y robots (Español).
ii linuxcnc-doc-fr 1:2.8.0 all motion controller for CNC machines and robots (French documentation)
un linuxcnc-sim <none> <none> (no description available)
un linuxcnc-sim-dev <none> <none> (no description available)
ii linuxcnc-uspace 1:2.8.0 amd64 motion controller for CNC machines and robots
ii linuxcnc-uspace-dev 1:2.8.0 amd64 PC based motion controller for real-time Linux
This should be my operating system info:
The file: /tmp/linuxcnc_info.txt
can be posted to a forum or a web site like:
http://pastebin.com
in order to provide information about the linuxcnc
system and configuration.
Date: Thu 10 Jun 2021 11:36:30 AM EDT
UTC Date: Thu 10 Jun 2021 03:36:30 PM UTC
this program: /usr/bin/linuxcnc_info
uptime: 11:36:30 up 1:03, 1 user, load average: 0.02, 0.04, 0.08
lsb_release -sa: Debian Debian GNU/Linux 10 (buster) 10 buster
which linuxcnc: /usr/bin/linuxcnc
pwd: /home/cnc/linuxcnc/configs/test_all_demo_files
USER: cnc
LOGNAME: cnc
HOME: /home/cnc
EDITOR:
VISUAL:
LANGUAGE:
TERM: dumb
COLORTERM:
DISPLAY: :0.0
DESKTOP: lightdm-xsession
display size: 800x600 pixels (211x158 millimeters)
PATH: /usr/bin:/home/cnc/linuxcnc/configs/test_all_demo_files/bin:/usr/bin:/home/cnc/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
uname items:
nodename -n: linuxcnc
kernel-name -s: Linux
kernel-vers -v: #1 SMP PREEMPT RT Debian 4.19.146-1 (2020-09-17)
machine -m: x86_64
processor -p: unknown
platform -i: unknown
oper system -o: GNU/Linux
/proc items:
cmdline: BOOT_IMAGE=/boot/vmlinuz-4.19.0-11-rt-amd64 root=UUID=9457fa4f-82b8-4c33-8384-2ef2f2f77780 ro initrd=/install/gtk/initrd.gz quiet
model name: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
cores: 1
cpu MHz: 3400.030
parport:
serial:
Versions:
gcc: gcc (Debian 8.3.0-6) 8.3.0
python: Python 2.7.16
git: git version 2.20.1
git commit: NA
tcl: 8.6
tk: 8.6
glade: not_in_PATH
glade-gtk2: not_in_PATH
linuxcnc_var all:
LINUXCNCVERSION: 2.8.0
LINUXCNC_AUX_GLADEVCP: /usr/share/linuxcnc/aux_gladevcp
LINUXCNC_AUX_EXAMPLES: /usr/share/linuxcnc/aux_examples
REALTIME: /etc/init.d/realtime
RTS: uspace
HALLIB_DIR: /usr/share/linuxcnc/hallib
dpkg -l "*linuxcnc*":
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===================-============-============-=====================================================================
un linuxcnc <none> <none> (no description available)
un linuxcnc-dev <none> <none> (no description available)
un linuxcnc-doc <none> <none> (no description available)
ii linuxcnc-doc-cn 1:2.8.0 all motion controller for CNC machines and robots (Chinese
ii linuxcnc-doc-en 1:2.8.0 all motion controller for CNC machines and robots (English documentation)
ii linuxcnc-doc-es 1:2.8.0 all controlador de movimiento para máquinas CNC y robots (Español).
ii linuxcnc-doc-fr 1:2.8.0 all motion controller for CNC machines and robots (French documentation)
un linuxcnc-sim <none> <none> (no description available)
un linuxcnc-sim-dev <none> <none> (no description available)
ii linuxcnc-uspace 1:2.8.0 amd64 motion controller for CNC machines and robots
ii linuxcnc-uspace-dev 1:2.8.0 amd64 PC based motion controller for real-time Linux
I do have the newer python installed but that file shows the older one
Hello,
have copy the soure from the homepage, unzip and start awlsim-win.cmd (use W7), python3 and pyqt5 is already install.
Opening the Hardware module setup, add rpigpio and remove, test it with add 3 times and remove one.
Program quit and show this:
awlsim-0.47>py -3 -O awlsim-gui
awlsim-gui: Using PyQt5 GUI framework
Traceback (most recent call last):
File "C:\Users\mhackspacher\Downloads\awlsim-0.47\awlsim\gui\hwmodconfig.py",line 357, in __handleDel
self.__loadedModDescs.remove(modDesc)
File "C:\Users\mhackspacher\Downloads\awlsim-0.47\awlsim\common\hwmod.py", line 117, in __eq__
return self.getIdentHash() == other.getIdentHash()
File "C:\Users\mhackspacher\Downloads\awlsim-0.47\awlsim\common\hwmod.py", line 109, in getIdentHash
h.update(pValue.encode("utf-8", "ignore"))
AttributeError: 'NoneType' object has no attribute 'encode'
Congratulations to your project, it is well done.
But I noticed that as many import * there, which has a reason?
https://github.com/mbuesch/awlsim/blob/master/awlsim/core/cpu.py#L34-L55
For me looks without * better, for example:
from awlsim.common.cpuspecs import S7CPUSpecs
Initialization of clock memory in coreserver startup is missing.
Fixed by a8a4a6e
Pending for Awlsim-0.61
Now I am making the Linuxcnc GUI on pyqt and want to embed awlsim in one of the tabs.
But starting with this code leads to a number of errors or freezes:
from awlsim.gui.mainwindow import *
class AwlsimWidget(QWidget):
def __init__(self, parent=None, path=None):
QWidget.__init__(self, parent)
try:
mainwnd = MainWindow.start()
layout = QHBoxLayout()
layout.addWidget(mainwnd)
self.setLayout(layout)
except Exception as e:
printDebug(_("Failed to import awlsim, {}",e))
Can you add a parameter to start awlism process in the window?
Like this:
self.process = QtCore.QProcess(self)
self.process.start('xterm',['-into', str(int(self.winId())), '-geometry', "600x60+0+400"])
Fixed in c2ad4ba
The handling of the STW OR bit is partially incorrect in U, UN, O, ON, X, XN, U(, UN(, O(, ON(, X( and XN( instructions.
This can lead to incorrect AWL program execution, if AND-before-OR (UND vor ODER) logic is used.
Programs that do not contain a plain O instruction (O instruction without operands) are not affected.
This will be fixed in awlsim-0.65.0
For example, L P#I0.0
loads the address of I0.0
.
Source: http://www.plcdev.com/siemens_s7_indirect_addressing
Awlsim shall support S5T immediates with underscores:
L S5T#1H_2M_3S_400MS
An error occurs when the server passes an instance of hal to gui.
Traceback (most recent call last):
File "/home/lcnc/awlsim/examples/linuxcnc-demo/../..//awlsim-linuxcnc-hal", line 438, in <module>
sys.exit(main())
File "/home/lcnc/awlsim/examples/linuxcnc-demo/../..//awlsim-linuxcnc-hal", line 394, in main
server.run()
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1691, in run
self.__handleCommunication() #@cy-win
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1466, in __handleCommunication
self.__handleSocketComm(rlist)
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1439, in __handleSocketComm
self.__handleClientComm(self.__sock2client[sock])
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1423, in __handleClientComm
handler(self, client, msg)
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1340, in __rx_GET_IDENTS
client.transceiver.send(reply)
File "/home/lcnc/awlsim/awlsim/coreserver/messages.py", line 1918, in send
data = memoryview(msg.toBytes())
File "/home/lcnc/awlsim/awlsim/coreserver/messages.py", line 1582, in toBytes
payload.append(self.packString(pVal))
File "/home/lcnc/awlsim/awlsim/coreserver/messages.py", line 180, in packString
return cls.packBytes(string.encode("utf-8", "strict"))
AttributeError: Pin 'encode' does not exist
In file "awlsim/coreserver/messages.py" attached such a bone:
175: @classmethod
def packString(cls, string):
try:
if not string:
string = ""
try:
ret=cls.packBytes(string.encode("utf-8", "strict"))
except:
ret=cls.packBytes("")
return ret
except UnicodeError as e:
raise ValueError
Non-English names are not displayed in the compiler window.
Instead of words it turns out "____".
//
// FUNCTION generated by Awlsim FUP compiler
//
// Source : 123 ____
// Compiler version : 0.73.0-pre
// AWL mnemonics : DE (German)
// Optimizers : grid-1: biefwd, lblrem, noprem
//
FUNCTION FC 1 : VOID
TITLE = 123 ____
FAMILY : FUP
VERSION : 0.73.0-pre
BEGIN
BE;
END_FUNCTION
Is it possible to do precompilation on the client side? A commonplace error in the name causes a stop CPU and there are no error messages on the client side.
awlsim-linuxcnc: [133.250] Awlsim error:
Multiple definitions of FC 1.
When you load an STL file, the error is at least highlighted in red, but when you work in FBD there are no messages or highlighting.
Also, the FBD source file is not indicated in the error, which greatly complicates the search.
awlsim-linuxcnc: [1919.813] Awlsim error:
Unconnected pin "Q" found in FUP element XOR(x3/y10, 2c096344..65166).
The reporting FUP/FBD element is:
FUP-grid
If there is no way to precompile on the client, is there a way to display the error in the server GUI?
Trying to run L W [P#M 0.0, P#0.0]
results in a crash, whereas the expected behaviour is to fail gracefully.
Stack trace:
AwlSimServer: Shutting down.
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/[...]/awlsim/awlsim/coreserver/server.py", line 1207, in <module>
sys.exit(AwlSimServer._execute())
File "/[...]/awlsim/awlsim/coreserver/server.py", line 207, in _execute
server.runFromEnvironment(env)
File "/[...]/awlsim/awlsim/coreserver/server.py", line 309, in runFromEnvironment
self.run()
File "/[...]/awlsim/awlsim/coreserver/server.py", line 1036, in run
self.__handleCommunicationBlocking()
File "/[...]/awlsim/awlsim/coreserver/server.py", line 900, in __handleCommunicationBlocking
self.__handleCommunication()
File "/[...]/awlsim/awlsim/coreserver/server.py", line 893, in __handleCommunication
self.__handleSocketComm(rlist)
File "/[...]/awlsim/awlsim/coreserver/server.py", line 868, in __handleSocketComm
self.__handleClientComm(self.__sock2client[sock])
File "/[...]/awlsim/awlsim/coreserver/server.py", line 858, in __handleClientComm
handler(self, client, msg)
File "/[...]/awlsim/awlsim/coreserver/server.py", line 637, in __rx_RUNSTATE
self.setRunState(self.STATE_RUN)
File "/[...]/awlsim/awlsim/coreserver/server.py", line 335, in setRunState
self.__sim.startup()
File "/[...]/awlsim/awlsim/core/main.py", line 42, in profiled_wrapper
func(self, *args, **kwargs)
File "/[...]/awlsim/awlsim/core/main.py", line 55, in awlSimErrorExtension_wrapper
func(self, *args, **kwargs)
File "/[...]/awlsim/awlsim/core/main.py", line 190, in startup
self.cpu.startup()
File "/[...]/awlsim/awlsim/core/cpu.py", line 846, in startup
self.prog.build()
File "/[...]/awlsim/awlsim/core/cpu.py", line 317, in build
self.__detectMnemonics()
File "/[...]/awlsim/awlsim/core/cpu.py", line 177, in __detectMnemonics
optrans.translateFromRawInsn(rawInsn)
File "/[...]/awlsim/awlsim/core/optrans.py", line 671, in translateFromRawInsn
opDesc = self.translateOp(rawInsn, rawOps)
File "/[...]/awlsim/awlsim/core/optrans.py", line 627, in translateOp
self.__translateAddressOperator(opDesc, rawOps[1:])
File "/[...]/awlsim/awlsim/core/optrans.py", line 345, in __translateAddressOperator
self.__translateIndirectAddressing(opDesc, rawOps[1:])
File "/[...]/awlsim/awlsim/core/optrans.py", line 299, in __translateIndirectAddressing
assert(offsetOpDesc.fieldCount == end)
AssertionError
An error occurs when a clean instance hal is passed to the descriptor.
Traceback (most recent call last): File "/home/lcnc/awlsim/examples/linuxcnc-demo/../..//awlsim-linuxcnc-hal", line 438, in <module> sys.exit(main()) File "/home/lcnc/awlsim/examples/linuxcnc-demo/../..//awlsim-linuxcnc-hal", line 390, in main server.setRunState(server.STATE_RUN) File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 642, in setRunState raise e AttributeError: 'unicode' object has no attribute 'ready'
In file "awlsim/awlsim/common/hwmod.py" empty quotes cause an error.
159: def setParameterValue(self, name, value):
"""Set the value of a parameter.
"""
self.parameters[name] = value or ""
self.__identHash = None
As I understand it, the error message code is not optimized to create localization. There is no great need for this, but it would be nice to add this feature too.
Just add "_ ()":
print(_("Triggered LinuxCNC E-Stop"))
Also need to be added at the beginning:
import locale
import gettext
and something like this:
locale.setlocale( locale.LC_ALL, '' )
locale.bindtextdomain( "awlsim", LOCALEDIR )
gettext.install( "awlsim", localedir = LOCALEDIR, unicode = True )
gettext.bindtextdomain( "awlsim", LOCALEDIR )
An attempt to trigger LinuxCNC E-Stop shall be made, if fatal exceptions occur in Awlsim.
Suggested by #20
L DBLG
L DBNO
L DILG
L DINO
According to the specification brackets and commas are not required for function block / function calls:
CALL FB 27 , DB 27
RZNR := EB11
Q1_IMP := L40.0
Q2_IMP := L40.1
FUNCTION FC 1 : VOID
VAR_INPUT
IN0 : INT;
END_VAR
BEGIN
L #IN0
END_FUNCTION
ORGANIZATION_BLOCK OB 1
BEGIN
UC FC 1
CALL SFC 46 // STOP CPU
END_ORGANIZATION_BLOCK
Traceback (most recent call last):
File "./awlsim-test", line 578, in <module>
sys.exit(main())
File "./awlsim-test", line 575, in main
return run(inputFile)
File "./awlsim-test", line 245, in run
s.runCycle()
File "/home/mb/develop/git/awlsim/awlsim/core/main.py", line 207, in runCycle
self.cpu.runCycle()
File "/home/mb/develop/git/awlsim/awlsim/core/cpu.py", line 882, in runCycle
self.__runOB(self.obs[1])
File "/home/mb/develop/git/awlsim/awlsim/core/cpu.py", line 823, in __runOB
insn.run()
File "/home/mb/develop/git/awlsim/awlsim/core/instructions/insn_l.py", line 42, in run
self.cpu.accu1.set(self.cpu.fetch(self.ops[0], {8, 16, 32}))
File "/home/mb/develop/git/awlsim/awlsim/core/cpu.py", line 1261, in fetch
return fetchMethod(self, operator, enforceWidth)
File "/home/mb/develop/git/awlsim/awlsim/core/cpu.py", line 1490, in fetchNAMED_LOCAL
return self.fetch(self.__translateFCNamedLocalOper(operator, False),
File "/home/mb/develop/git/awlsim/awlsim/core/cpu.py", line 1201, in __translateFCNamedLocalOper
interfOp = self.callStackTop.interfRefs[operator.interfaceIndex].resolve(store)
AttributeError: 'CallStackElem' object has no attribute 'interfRefs'
It should fail gracefully instead.
When in gui you change the number of inputs or outputs, the hal component is not updated.
Traceback (most recent call last):
File "/home/lcnc/awlsim/examples/linuxcnc-demo/../..//awlsim-linuxcnc-hal", line 441, in <module>
sys.exit(main())
File "/home/lcnc/awlsim/examples/linuxcnc-demo/../..//awlsim-linuxcnc-hal", line 397, in main
server.run()
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1683, in run
self.__handleCommunicationBlocking()
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1506, in __handleCommunicationBlocking
self.__handleCommunication()
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1466, in __handleCommunication
self.__handleSocketComm(rlist)
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1439, in __handleSocketComm
self.__handleClientComm(self.__sock2client[sock])
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1423, in __handleClientComm
handler(self, client, msg)
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1049, in __rx_RUNSTATE
self.setRunState(self.STATE_RUN)
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 642, in setRunState
raise e
AttributeError: Pin 'output.u31.6.active' does not exist
To reload hal you can use a bash script like this:
halcmd unloadusr awlsim
halcmd loadusr -Wn awlsim awlsim-linuxcnc-hal --listen localhost:4151 linuxcnc-demo.awlpro
But "unloadusr" breaks all networks, so it's better to call "source":
halcmd unloadusr awlsim
halcmd source awlsim.hal
It would also be nice to have this code called when the awlsim component crash:
import linuxcnc
command = linuxcnc.command()
command.state( linuxcnc.STATE_OFF )
command.state( linuxcnc.STATE_ESTOP )
command.wait_complete()
For example, if a component stops during a zero search on a machine, this will result in physical damage to the axis, so it is better to stop the component. You can also add a parameter for the user what to do during an accident.
I am admittedly having a hard time with this part! I am not sure where to go next but other than AWL file issues I think this is my last hurdle.
Do I need some commercial ethernet to PLC hardware? The machine uses RS485 in particular, and I have all sorts of adapters.
Also is there some slack channel for forum we can use for support / documentation?
On Windows, the system works as usual, but on Linux the Avlsim interface freezes. If you do not press the disconnect button, then everything also works as usual.
Steps to reproduce the issue:
AwlSimServer: [2.304] Received message: RUNSTATE 0
awlsim-gui: [5.546] AwlSimClient: Received message 0x0000
AwlSimServer: [2.305] Client '[127.0.0.1]:36058' disconnected
AwlSimServer: [5.212] Received signal 15
AwlSimServer: [5.213] Switched to AUTO garbage collection.
When gui reloads the program, the instance variable hal is cleared. The hal.ready () function is also executed twice, which causes an error.
Traceback (most recent call last):
File "/home/lcnc/awlsim/examples/linuxcnc-demo/../..//awlsim-linuxcnc-hal", line 438, in <module>
sys.exit(main())
File "/home/lcnc/awlsim/examples/linuxcnc-demo/../..//awlsim-linuxcnc-hal", line 394, in main
server.run()
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1683, in run
self.__handleCommunicationBlocking()
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1506, in __handleCommunicationBlocking
self.__handleCommunication()
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1466, in __handleCommunication
self.__handleSocketComm(rlist)
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1439, in __handleSocketComm
self.__handleClientComm(self.__sock2client[sock])
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1423, in __handleClientComm
handler(self, client, msg)
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 1049, in __rx_RUNSTATE
self.setRunState(self.STATE_RUN)
File "/home/lcnc/awlsim/awlsim/coreserver/server.py", line 642, in setRunState
raise e
AttributeError: 'unicode' object has no attribute 'ready'
I came up with adding a global variable for hal instance.
In file "awlsim/coreserver/server.py" added
304: self.linuxcncHALcomponent = None
and
961: if "linuxcnc" in hwmodName:
hwmodDesc.setParameterValue('hal',self.linuxcncHALcomponent)
In file "awlsim_linuxcnc_hal"
359: server.linuxcncHALcomponent = hal
In file "awlsimhw_linuxcnc/main.py"
207: if not self.LinuxCNC_HAL.component_is_ready("awlsim"):
self.hal.ready()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.