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

modbus-ng #227

Open
diplfranzhoepfinger opened this issue Sep 13, 2024 · 1 comment
Open

modbus-ng #227

diplfranzhoepfinger opened this issue Sep 13, 2024 · 1 comment

Comments

@diplfranzhoepfinger
Copy link

@mx990 

i wanted to have a look at Modbus-NG. 

https://git.eclipse.org/r/c/4diac/org.eclipse.4diac.forte/+/139743

can you please drop me a E-Mail, or help me here,  i am searching the FBs for Bus, Slave etc..

Thanks many times.

@mx990
Copy link
Member

mx990 commented Sep 13, 2024

Thank you for your interest in the modbus-ng I/O interface. I was unfortunately unable to locate the original FB type files from back then, but I quickly re-created them for you based on the generated code: eclipse-4diac/4diac-ide#477

The Slave FB types are specific to the respective device, so I did not include them. The slave devices need to be SIFBs with the following interface:

		<EventInputs>
			<Event Name="MAP" Type="Event" Comment="Service Initialization">
				<With Var="QI"/>
<!--				<With Var="<IO Name>"/> -->
				<With Var="Unit"/>
				<With Var="UpdateInterval"/>
			</Event>
		</EventInputs>
		<EventOutputs>
			<Event Name="MAPO" Type="Event" Comment="Initialization Confirm">
				<With Var="QO"/>
				<With Var="STATUS"/>
			</Event>
			<Event Name="IND" Type="Event" Comment="Indication from Resource">
				<With Var="QO"/>
				<With Var="STATUS"/>
			</Event>
		</EventOutputs>
		<InputVars>
			<VarDeclaration Name="QI" Type="BOOL" Comment="Event Input Qualifier"/>
<!--			<VarDeclaration Name="<IO NAME>" Type="WSTRING" Comment="I/O Name"/> -->
			<VarDeclaration Name="Unit" Type="USINT" Comment="Modbus Unit Identifier"/>
			<VarDeclaration Name="UpdateInterval" Type="UINT" Comment="Update Interval"/>
		</InputVars>
		<OutputVars>
			<VarDeclaration Name="QO" Type="BOOL" Comment="Event Output Qualifier"/>
			<VarDeclaration Name="STATUS" Type="WSTRING" Comment="Service Status"/>
		</OutputVars>

The exported code then needs to be adapted to inherit from ModbusSlave and implement the required functionality, see also SlaveFestoCMMP_AS.h and SlaveFestoCMMP_AS.cpp.

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