Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_ny_name problem #2

Open
twoway opened this issue Jul 24, 2020 · 1 comment
Open

read_ny_name problem #2

twoway opened this issue Jul 24, 2020 · 1 comment

Comments

@twoway
Copy link

twoway commented Jul 24, 2020

Hi
I hope to get some help with this problem.

I have a working connection to PLC and can read info.
When i do this i get correct answer:
pprint.pprint(device.read_by_name('METERS._EM01_I_MAX_PV', REAL)) ##This works
when i do this i get fault below:
pprint.pprint(device.read_by_name(tag_names[4], tag_types[4]))
if i replace tag_types[4] with REAL i get no error...

[2020-07-24 16:29:38,285][3988:MainThread][adsclient.py/exit][WARNING] AdsClient exiting with exception: <type 'exceptions.AssertionError'>, . <traceback object at 0x76640918>
Traceback (most recent call last):
File "twincat_plc_info_m4.py", line 67, in
main()
File "twincat_plc_info_m4.py", line 54, in main
pprint.pprint(device.read_by_name(tag_names[0], tag_types[0]))
File "/usr/local/lib/python2.7/dist-packages/counsyl_pyads-1.0.0-py2.7.egg/counsyl_pyads/adsclient.py", line 273, in read_by_name
assert(isinstance(ads_data_type, AdsDatatype))
AssertionError

@jonemo
Copy link

jonemo commented Oct 18, 2020

Hi @twoway, it looks like the value of your variable tag_types[4] is not equal to the value of your variable REAL. The error message suggests that tag_types[4] has a different data type than expected.

A good next step for debugging this might be to find out the exact content of tag_types[4], maybe using a debugger or using print:

print type(tag_types[4])
print tag_types[4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants