Handle a recorder in JS

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Handle a recorder in JS

2,486 次查看
FaustoPignatta
Contributor I

Hi,

there is an example that describes how to implement a recorder in JS scripting?

Many thanks

 

Fausto

0 项奖励
回复
6 回复数

2,478 次查看
FaustoPignatta
Contributor I

Hi Daniel,

I'm using Freemaster to create a debug page of my application (that runs on s32k148 micro). I have created an html page and use JS scripting.

I've tried to use this function

PCM.prototype.SetupRecorder = function(idconfigvars)... (freemaster-client.js)
 
without success.
 
Many thanks,
 
Fausto
0 项奖励
回复

2,457 次查看
iulian_stan
NXP Employee
NXP Employee

Hi @FaustoPignatta,

Are you using FreeMASTER (GUI tool) or FreeMASTER Lite as a backend for html page ?

I am asking because SetupRecorder is a special case - specific to FreeMASTER Lite (won't work with main FreeMASTER tool). The GUI tool has an alternative function DefineRecorder (6.5.41 User Manual).

Depending on your use case we will provide a corresponding example.

Regards,
Iulian

0 项奖励
回复

2,455 次查看
FaustoPignatta
Contributor I

Hi Iulian,

I'm using Freemaster (Gui Tool), and i put in my project these files (like I see in scripting example ..\FreeMASTER 3.0\FreeMASTER\examples\scripting\JavaScript-JSON-RPC):

- freemaster-client.js 

- simple-jsonrpc.js

 

Thanks

Fausto

0 项奖励
回复

2,450 次查看
MichalH
NXP Apps Support
NXP Apps Support

Dear Fausto,

The Oscilloscope is more a user-interactive feature than a programmatic one in the FreeMASTER Desktop application. There is actually no JSON-RPC API to consume oscilloscope data in the script as such script would depend heavily on what oscilloscope item is currently selected in the project tree. 

There is an API though to create the Oscilloscope item and populate it with selected variables just like if the user would create it by hand. There is also an API to activate the newly created item in the project tree so that the oscilloscope graph becomes visible in the desktop window. See DefineOscilloscope and SelectItem API calls in the User Guide.

In the FreeMASTER Desktop application, the only way how to get variable values in run-time is reading them programmatically in a script using the ReadVariable or similar methods. This is a good approach as it works any time, regardless of what screen the user currently activates in the UI.

As Iulian mentioned above, the FreeMASTER Lite backend enables an access to Oscilloscope feature at the protocol level, so it might be more suitable for you if you really need a high-speed data sampling.

Regards,
Michal

0 项奖励
回复

2,447 次查看
FaustoPignatta
Contributor I

Hi Michal,

thanks for the suggestion. I've declared some array MCU side and read them in my desktop application with pcm.ReadUIntArray function. In my application I don't need to see real time values but only to acquire them in the fastest way, and at the end of process analyze them.

Thanks,

Fausto

0 项奖励
回复

2,480 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Which NXP product do you use?

 

Thanks,

BR, Daniel

0 项奖励
回复