LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementation of agent function created by Matlab Reinforcement Learning toolbox into Labview Matlab Script node.

Could anyone please show me how to implement "Agent" function generated by MATLAB "Reinforcement Learning Toolbox" into Labview "Matlab Script Node"? What I have done so far is:

 

1. " Agent" I'm using is in Matlab "Reinfrocement Learning Toolbx" example "Create Simulink Environment and Train Agent". They have pre-traind Agent "WaterTankDDPG.mat".

 website: https://jp.mathworks.com/help/reinforcement-learning/ug/create-simulink-environment-and-train-agent....

 

2. Using "WaterTankDDPG.mat" I run "generatePolicyFunction(agent)" and get "evaluatePolicy.m" and "agentData.mat"

  (Matlab command)

>> load('WaterTankDDPG.mat','agent')

>>generatePolicyFunction(agent)

 

3. I implement this into matlab function on Simulink and checked if it works. It worked well.

(attached file:

  check_agent1.slx : input three number and check output

  check_agent2.slx: control tank level )

 

4. So I opend new Vi on Labview, place "Matlab Script Node", and import "evaluatePolicy.m" from matlab folder.

 

5. I built Vi's exactly same as simulink model and run.

(attached file:

  check_agent1.vi : input three number and check output

  check_agent2.vi: control tank level )

 

6. It didn't work. And appear error like below in both case. (screen shot "error_message.PNG" attached)

" Error 1050 occurred at LabVIEW: (Hex 0x441) Error occurred while executing script. Error message from server: ??? エラー: このコンテキストでは関数定義がサポートされません。関数はコード ファイル内でローカル関数または入れ子関数としてのみ作成できます。 ".

japanese part translation cuold be "Function definitions are not supported in this context. Functions can only be created as local or nested functions in the code file."

 

Please give me advice. (Matlab 2021b, Labview 2021 64bit)

 

Actually, It has been one month since I asked this trouble to NI tech support in Japan but I have got no satisfactory answer yet.

0 Kudos
Message 1 of 1
(715 Views)