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

batch processing ID& Registers #24

Open
claudioliciotti opened this issue Mar 14, 2019 · 1 comment
Open

batch processing ID& Registers #24

claudioliciotti opened this issue Mar 14, 2019 · 1 comment

Comments

@claudioliciotti
Copy link

coud be possible to receive info about the syntax that should be used in the "ID & registers" field for Batch processing?

@IniterWorker
Copy link

IniterWorker commented Apr 17, 2020

Batch Processing Logic

  • src/BatchProcessor
void BatchProcessor::runBatch()
{
	const int func = stringToHex( embracedString( ui->functionCode->currentText() ) );

	const QStringList slaves = ui->slaveEdit->text().split( ';' );

	QTextStream out( &m_outputFile );

	foreach( const QString &slaveCfg, slaves )
	{
		if( slaveCfg.contains( ':' ) )
		{
			const int slaveID = slaveCfg.split( ':' ).first().toInt();
			const QStringList addresses = slaveCfg.split( ':' ).last().split( ',' );
			foreach( const QString &addr, addresses )
			{
				out << QDateTime::currentDateTime().toTime_t() << slaveID << ", " << addr.toInt() << ", " << sendModbusRequest( slaveID, func, addr.toInt() ) << endl;
			}
		}
	}
}

Review

I'm not currently sure about how it works in deep.

Basic

#ID:#Addr,#Addr

Advanced

#ID:#Addr,#Addr;#ID:#Addr,#Addr;#ID:#Addr,#Addr;#ID:#Addr,#Addr

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