flutter_fins_protocol 1.0.1
flutter_fins_protocol: ^1.0.1 copied to clipboard
Flutter Fins Protocol library is a fins protocol based communication library for Omron plc.
Flutter FINS Protocol #
This package was developed to communicate with Omron PLCs that are in the same local network and use the FINS protocol.
Installation #
$ flutter pub add flutter_fins_protocol
Usage #
Currently all operations are done via Python using shell commands. Therefore Python needs to be installed. You can use the following command to check if it is installed and install it if it is not installed.
bool success = await Python.installScript();
if(success){
//Commands to run if Python is installed
}
You can create an instance using the dynamicIp() and staticIp(String ip) static methods included in the FlutterFinsProtocol class, whichever suits you best.
FinsProtocolDynamic finsDynamic = FlutterFinsProtocol.dynamicIp();
FinsProtocolStatic finsStatic = FlutterFinsProtocol.staticIp("192.168.250.20");
You only need to define an IP once in the instances you create with staticIp. This is generally preferable when working with a single PLC.
If you need to communicate with more than one PLC continuously, you can choose to create an instance with dynamicIp. You need to specify the IP address for each operation (write, read etc.).
String result = await fins.write("192.168.250.20", MemoryAreas.DM, 100, [0, 4], 01);
print(result);
See the test folder for more examples.
Contributing #
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.