Automating SAM with LK script

  • Carlos
  • Topic Author
More
15 May 2020 09:20 #8200 by Carlos
Automating SAM with LK script was created by Carlos
Hi,

Is there any way to run a LK script without graphical interface? I've prepared a LK script that read some files to adjust some parameteres for the simulation and also to get the results as a CSV file.
This works fine but my purpose is doing this whout graphifcal inteface, like command line (thouhght SDK or pysam or something).
Is there any way to do this? Is posible to run a script via samtools, pysam, sdk, ...?

Thanks in advance,
Carlos.

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
15 May 2020 20:21 #8206 by Paul Gilman
Replied by Paul Gilman on topic Automating SAM with LK script
Hi Carlos,

We are working implementing the capability to run an LK script from the command line. Please see this GitHub.com Issue for more information:

github.com/NREL/SAM/issues/309

In the meantime, the only option for running an LK script outside of the SAM desktop application is to use SDKtool as described on the SAM SDK page of the SAM website:

sam.nrel.gov/sdk

Note that LK is slightly different in different contexts. For example in a script made to run in SAM, you use set() and get() to set and get values of variables. In LK for SDKtool, you use var(). The function reference in each environment lists the functions that work in that environment.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

  • Juan Manuel
More
11 Jun 2020 15:09 #8299 by Juan Manuel
Replied by Juan Manuel on topic Automating SAM with LK script
Hi Paul,

I have seen the issue github.com/NREL/SAM/issues/309 has been closed.

I have two doubts:
1. The command line is for lk for sam or lk for sdk?
2. How would a command line script be launched? Is it only for linux?
    If I run ./sam.bin in linux it returns the following error:
    error while loading shared libraries: ssc.so: cannot open shared object file: No such file or directory

Thank you!

Juan.

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
15 Jun 2020 19:32 #8306 by Paul Gilman
Replied by Paul Gilman on topic Automating SAM with LK script
Dear Juan,

The milestone associated with GitHub Issue #309 is "2020 Patch 3" which indicates that it will be included as part of the third update to SAM 2020.2.29, which we have not yet released. We are currently on SAM 2020.2.29 Revision 2 -- that update will be SAM 2020.2.29 Revision 3.

We will release Revision 3 soon, when we have fixed any remaining issues with SAM 2020.2.29 Revision 2.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
31 Jul 2020 22:00 - 31 Jul 2020 22:22 #8514 by Paul Gilman
Replied by Paul Gilman on topic Automating SAM with LK script
Dear Juan,

As of SAM 2020.2.29 r3, released today, you can run an LK script from the command line. The syntax is:

[path to SAM executable] [any string] [path to .lk script file]

Note the spaces between each parameter.

For example, in Windows, the command might look like this:

c:/sam/2020.2.29/x64/sam.exe not-a-sam-file c:/test.lk

Running that in a Command or Terminal window will start the SAM desktop application, open the .lk file in a script editor and run the script (equivalent to clicking the Run button in the script editor). The middle parameter is required (it can be any string), but does not do anything. You have to manually close SAM when you are finished.

You can also use the following to open a .sam file from the command line:

[path to SAM executable] [path to .sam file]

Best regards,
Paul.
Last edit: 31 Jul 2020 22:22 by Paul Gilman.

Please Log in or Create an account to join the conversation.

  • Joel Bulow
More
09 Dec 2020 02:20 #9074 by Joel Bulow
Replied by Joel Bulow on topic Automating SAM with LK script
Hi,
Is there any way to run an LK script from a .sam file in the command line. Currently I can use [path to SAM executable] [any string] [path to .lk script file] however I would like to be able to run an LK script based on parameters in a particular .sam file. For instance, something like [path to .sam] [path to .lk script file]. Is this possible?
Thanks

Please Log in or Create an account to join the conversation.

Moderators: Paul Gilman
Powered by Kunena Forum