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/write real #6

Open
xtrinch opened this issue Aug 16, 2018 · 0 comments
Open

Read/write real #6

xtrinch opened this issue Aug 16, 2018 · 0 comments

Comments

@xtrinch
Copy link
Owner

xtrinch commented Aug 16, 2018

Add to PLC.java:

public double getReal(boolean fromPLC,int address) throws Exception {
	int val = this.getDInt(fromPLC, address);
	return Float.intBitsToFloat(val);
}

public void putReal(boolean fromPLC,int address, double val) throws Exception {
	int valb = Float.floatToIntBits((float) val);
	this.putDInt(fromPLC, address, valb);
}
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

1 participant