René's URL Explorer Experiment


Title: examples/simple_ds402_node.py uses contradictory PDO mapping patterns · Issue #496 · canopen-python/canopen · GitHub

Open Graph Title: examples/simple_ds402_node.py uses contradictory PDO mapping patterns · Issue #496 · canopen-python/canopen

X Title: examples/simple_ds402_node.py uses contradictory PDO mapping patterns · Issue #496 · canopen-python/canopen

Description: The example uses the RemoteNode.load_configuration() API to send ParameterValue settings given in the sample EDS file to the device. This used to work in conjunction with PdoBase.read() to synchronize the locally cached PDO configuration...

Open Graph Description: The example uses the RemoteNode.load_configuration() API to send ParameterValue settings given in the sample EDS file to the device. This used to work in conjunction with PdoBase.read() to synchron...

X Description: The example uses the RemoteNode.load_configuration() API to send ParameterValue settings given in the sample EDS file to the device. This used to work in conjunction with PdoBase.read() to synchron...

Opengraph URL: https://github.com/canopen-python/canopen/issues/496

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"examples/simple_ds402_node.py uses contradictory PDO mapping patterns ","articleBody":"The example uses the `RemoteNode.load_configuration()` API to send `ParameterValue` settings given in the sample EDS file to the device.  This used to work in conjunction with `PdoBase.read()` to synchronize the locally cached PDO configuration and mapping info.  Calling that method (on any PDO) was therefore not really necessary, as it was implied as a final step in `load_configuration()`.\r\n\r\nBut #427 changed this and made `load_configuration()` apply the PDO configuration through calls to `PdoBase.save()` instead.  Thus the need to read it back was eliminated.\r\n\r\nIn any case, the example goes on to call `BaseNode402.setup_402_state_machine()`, which then reads back the PDO configuration again.  Here it would help to pass `read_pdos=False` since we know that the configuration was just saved, skipping the unnecessary upload.\r\n\r\nThat convenience method also checks whether needed values like the status and control words are configured in the respective PDOs.  Which should succeed because of the initialization values in the sample EDS (haven't tested).\r\n\r\nBut then the example code continues with re-mapping the PDOs, which (probably?) invalidates the `rpdo_pointers` and `tpdo_pointers` entries pointing at the previous PDO mapping's `PdoVariable` objects.  This should be done before `setup_402_state_machine()` to avoid this error.  In addition, the example first uses `node.tpdo.read()` and `node.rpdo.read()` before adjusting the mappings, which, again, is unnecessary after `load_configuration()`.\r\n\r\nFurthermore, before the PDO re-mapping, it tries to change the `node.state` attribute, but there is no prior change of `node.nmt.state = 'OPERATIONAL'`, thus the exchanges of control and status words cannot work.  There is a fallback to SDO implemented if no PDO maps the required objects, but that is not triggered because they are in fact mapped.  The problem is that in PRE-OPERATIONAL state, the node's PDOs simply do not function.  Re-mapping them after the previous `PdoVariable` objects have been cached (see above) doesn't make this any better.\r\n\r\nThese are some observations from trying to understand the sample code, showing that it is mostly broken for actual usage and suggests wrong or inefficient patterns of the library API usage.  There may be more problems hidden, which could be revealed after testing with actual hardware.  Maybe that was done at some point, but probably not after the library API has evolved and some functionality (especially regarding profile CiA402) moved around.\r\n\r\nWe should discuss how to make this example actually useful again, or at the very minimum, document that it serves only as a demonstration of the API and will not work with real hardware unless the user takes care of the issues with their hopefully firm CANopen background themselves.","author":{"url":"https://github.com/acolomb","@type":"Person","name":"acolomb"},"datePublished":"2024-07-04T21:32:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/496/canopen/issues/496"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fa9745e2-2f1c-b4d8-9c00-275e8b7271fb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE5D0:3DA5C6:116349D:174F2DD:6A5EF2D4
html-safe-noncecbd580aebd03e449d5469a06ff91e93dfe31e7f2eb5ccccdc469d30f74986ca0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUQwOjNEQTVDNjoxMTYzNDlEOjE3NEYyREQ6NkE1RUYyRDQiLCJ2aXNpdG9yX2lkIjoiODExMDAzMDc2MjE5OTE1MTMxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca51e06bb47d0cff6f7bee2e29dee77e1d9b65eb0c5c5c70feb9fe40ddbd7b6f0
hovercard-subject-tagissue:2391483102
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/canopen-python/canopen/496/issue_layout
twitter:imagehttps://opengraph.githubassets.com/72ded9253e84c607c959c9aa2276f902fb65d2921c0df2ebe843f57fce8343f1/canopen-python/canopen/issues/496
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/72ded9253e84c607c959c9aa2276f902fb65d2921c0df2ebe843f57fce8343f1/canopen-python/canopen/issues/496
og:image:altThe example uses the RemoteNode.load_configuration() API to send ParameterValue settings given in the sample EDS file to the device. This used to work in conjunction with PdoBase.read() to synchron...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameacolomb
hostnamegithub.com
expected-hostnamegithub.com
None82d0004a35927bdb00c652a57f456c55aa0eda4ade1bc7956d7510fdea6e454b
turbo-cache-controlno-preview
go-importgithub.com/canopen-python/canopen git https://github.com/canopen-python/canopen.git
octolytics-dimension-user_id200581454
octolytics-dimension-user_logincanopen-python
octolytics-dimension-repository_id68737600
octolytics-dimension-repository_nwocanopen-python/canopen
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id68737600
octolytics-dimension-repository_network_root_nwocanopen-python/canopen
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released2d913dd727d2d7ac189fb4d05b10bc34ecd03ee
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/canopen-python/canopen/issues/496#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcanopen-python%2Fcanopen%2Fissues%2F496
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcanopen-python%2Fcanopen%2Fissues%2F496
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=canopen-python%2Fcanopen
Reloadhttps://github.com/canopen-python/canopen/issues/496
Reloadhttps://github.com/canopen-python/canopen/issues/496
Reloadhttps://github.com/canopen-python/canopen/issues/496
Please reload this pagehttps://github.com/canopen-python/canopen/issues/496
canopen-python https://github.com/canopen-python
canopenhttps://github.com/canopen-python/canopen
Notifications https://github.com/login?return_to=%2Fcanopen-python%2Fcanopen
Fork 359 https://github.com/login?return_to=%2Fcanopen-python%2Fcanopen
Star 562 https://github.com/login?return_to=%2Fcanopen-python%2Fcanopen
Code https://github.com/canopen-python/canopen
Issues 53 https://github.com/canopen-python/canopen/issues
Pull requests 20 https://github.com/canopen-python/canopen/pulls
Discussions https://github.com/canopen-python/canopen/discussions
Actions https://github.com/canopen-python/canopen/actions
Projects https://github.com/canopen-python/canopen/projects
Security and quality 0 https://github.com/canopen-python/canopen/security
Insights https://github.com/canopen-python/canopen/pulse
Code https://github.com/canopen-python/canopen
Issues https://github.com/canopen-python/canopen/issues
Pull requests https://github.com/canopen-python/canopen/pulls
Discussions https://github.com/canopen-python/canopen/discussions
Actions https://github.com/canopen-python/canopen/actions
Projects https://github.com/canopen-python/canopen/projects
Security and quality https://github.com/canopen-python/canopen/security
Insights https://github.com/canopen-python/canopen/pulse
examples/simple_ds402_node.py uses contradictory PDO mapping patterns https://github.com/canopen-python/canopen/issues/496#top
code-qualityhttps://github.com/canopen-python/canopen/issues?q=state%3Aopen%20label%3A%22code-quality%22
pdohttps://github.com/canopen-python/canopen/issues?q=state%3Aopen%20label%3A%22pdo%22
https://github.com/acolomb
acolombhttps://github.com/acolomb
on Jul 4, 2024https://github.com/canopen-python/canopen/issues/496#issue-2391483102
#427https://github.com/canopen-python/canopen/pull/427
code-qualityhttps://github.com/canopen-python/canopen/issues?q=state%3Aopen%20label%3A%22code-quality%22
pdohttps://github.com/canopen-python/canopen/issues?q=state%3Aopen%20label%3A%22pdo%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.