question

立洲 avatar image
0 Likes"
立洲 asked 立洲 commented

How to get the result of sending a signal to the outside

我想在代碼打印中寫一個(結果)來打印一個 Global Talbe 實驗結果。

1649733619706.png

applicationcommand("sendhttpreqeust", "POST", "192.168.168.100", "/relativeP?info=[50,0,0,0,0,0]&speed=0.5", "", 0, 結果);
FlexSim 20.0.10
httprest apiprintf
1649733619706.png (93.6 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

via Google Translate:

I want to write a (result) in code print to print a Global Table experiment result.

0 Likes 0 ·
Ryan Clark avatar image Ryan Clark commented ·

Hi @立洲 , was Ben Wilson's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Ben Wilson avatar image
0 Likes"
Ben Wilson answered 立洲 commented

This answer explains in detail each of the parameters used in a call to applicationcommand("sendhttprequest").

The result parameter is a treenode. This is where the data returned from the remote server will be written.

Result could be a treenode that you manually insert into the tree, it could be a string label on any object. It could be a cell of a global table toggled for string data.

Here is an example populating a table cell with the data returned from an HTTP request:

1649774282211.png

By the way, the code block in your question has a typo - sendhttpreqeust - you inverted the U and E. It should be "sendhttprequest".

Here is that example model: saveGetToTableCell.fsm

Good luck!


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

立洲 avatar image 立洲 commented ·

@本威爾遜感謝您的幫助和提醒

1 Like 1 ·