Page 2 of 2

Re: How to log from instrument code

Posted: Sat Jun 26, 2021 10:24 pm
by Tetrachromat
Oh, great idea to use inter-instrument communications. Yes that would make sense for that use case.

I just need one framework object that acts as a logger, publishing the received log messages to SI, which acts as message broker, and one instrument with the canvas as console, subscribing to the messages from SI. A bit elaborated but a most generic solution.

Hey you guys are great. Thanks a lot.

Paul

Re: How to log from instrument code

Posted: Sat Jun 26, 2021 10:25 pm
by Keith Baxter
Hi,

Thinking about it. and I have not tried it.

Using inter instrument communication. if you subscribe to the dataref whatever is written to the dataref should be received in the subscribe. So if my understanding is correct it should be possible.

Keith

Re: How to log from instrument code

Posted: Sun Jun 27, 2021 1:14 am
by Sling
Hi,

Just seen this. You can indeed use iic to send messages. In fact you can use it as a way of creating a remote console. Probably don’t need to bother with tables unless you have a ton of data. Make yourself a remote console (rx) to run in AM and add the iic sends anywhere in your instruments (tx) you want to see output in the AM console. I’ve used this a couple of times to help understand a couple of multi instrument related issues during development. Remember to remove or comment out it all when you are done.

Tony