Trace32: How get programmatically get maintenance key expiry month and year using t32apinet? - jtag

I am trying to get the maintenance key expiry month and year of lauterbach JTAG programmatically. I am using t32apinet for that. Is there a way to read the maintenance information using the api?

You can get the date of you maintenance key via the PRACTICE function LICENSE.DATE(<idx>), where idx is the number of the attached serial number as it appears in the LICENSE.LIST window. Note, that one debug cable, plugged to your PowerDebug, can have up to 5 serial numbers and thus, also up to 5 maintenance key.
To get idx for the currently running PowerView executable use the PRACTICE function LICENSE.getINDEX().
Putting both together you get: LICENSE.DATE(LICENSE.getINDEX())
You can test it by using the PRINT command in PowerView:
PRINT LICENSE.DATE(LICENSE.getINDEX())
You should get a string in the form of YYYY/MM e.g. 2020/07
To use a PRACTICE function via the remote API, use the API function T32_Cmd() together with the TRACE32 command EVAL and then get the result via the API function T32_EvalGetString().
E.g. in C/C++:
char mdate[4096];
T32_Cmd("EVAL LICENSE.DATE(LICENSE.getINDEX())");
T32_EvalGetString(mdate);
printf("End Date: %s\n", mdate);
I am not skilled with Visual Basic .NET at all, but I guess there it should look like this:
Dim mdate As String
T32.Cmd("EVAL LICENSE.DATE(LICENSE.getINDEX())");
T32.EvalGetString(mdate);
Log("End Date: " + mdate)
New versions of TRACE32 support also the slightly nicer API function T32_ExecuteFunction().

Related

Try to MatchAll a string in Power Apps

I've been programming in Power Apps for some time now (but I'm not a specialist). I'm trying to pass an array from Power Automate to Power Apps.
I was able to do that with a string and after a few more steps I have the following text:
[{"Messung":1;"Tiegel leer":"16;5469";"Tiegel Probe":"27;6659";"Tiegel Asche":"17;6549"}]";"[{"Messung":2;"Tiegel leer":"16;9654";"Tiegel Probe":"26;5476";"Tiegel Asche":"17;6549"}]";"[{"Messung":3;"Tiegel leer":"17;0256";"Tiegel Probe":"27;9862";"Tiegel Asche":"18;2235"}"]
I would like to convert this back to a data table with a MatchAll command, unfortunately I do not understand the Microsoft explanation for this command at all. I can convert the semicolons in the values ​​back into commas later, but I needed the semicolons (language dependency, programming in German)
My plan was to do the conversion using a ClearCollect(MatchAll....) command.
I seem to be able to get these individually for my individual columns
(; <Tiegel_leer>;<Tiegel_Probe> & <Tiegel_Asche>).
ClearCollect(ResultAG;MatchAll(Label40_1.Text;"(""Messung"":(?[^""]))"));;
ClearCollect(ResultAG;MatchAll(Label40_1.Text;"(""Tiegel Probe"":(?<Tiegel_Probe>[^""]))"));;
ClearCollect(ResultAG;MatchAll(Label40_1.Text;"(""Tiegel leer"":(?<Tiegel_leer>[^""]))"));;
ClearCollect(ResultAG;MatchAll(Label40_1.Text;"(""Tiegel Asche"":(?<Tiegel_Asche>[^""]))"))
But I can't connect these lines with each other and I still don't really understand it. These lines were also created more by trial and error than by understanding.
Would be glad if someone could help me with this.
Thanks for helping
Using MatchAll approach is very old and complex approach to parse the array of objects (data) sent from Power automate to Power apps.
I would suggest you to use the recently released ParseJSON function in Power apps instead of MatchAll function for this.
For detailed information and tutorial, check:
Power Fx: Introducing ParseJSON
ParseJSON function in Power Apps (experimental)
ParseJSON function in Power Apps - Video

Automatically generate Date + 4-digit sequence number for ID in Access 2010+

I need to automatically generate a 12 character value for my Business Key. Without any user interaction.
8 character -> Today Date (yyyymmdd or ddmmyyyy).
+
4 character -> Sequential Number (0001,0002,0003).
The Sequential Number must reset on each new day.
Is it possible to do this in Microsoft Access 2010+ without any coding involved?
Since you are using Access 2010+ the best way to accomplish your goal would be to use a Before Change data macro like this
To create the Before Change macro, click the "Before Change" button on the "Table" tab of the ribbon when the table is open in Datasheet View:
For more details on Data Macros see
Create a data macro
Good question, thanks for the challenge!
After some search, it seems it's possible to do that.
You can prefix the AutoNuber value by processing like the explanation available here: http://www.databasedev.co.uk/add_prefix.html
You can try to specify in the format of the field a format(now(),"ddmmyyyy").
Check this page for more informations, another user seems to have the same problem and got a solution: http://bytes.com/topic/access/answers/695188-custom-made-autonumber-show-todays-date
Hope it's helping you!

MVS OS-390 - How do I Capture Job Information from CA-JOBTRAC programmatically

I am using REXX to invoke JOBTRAC programmatically which works however I am unable to pass JOBNAME arguments using this approach. Can this be done using REXX?
The idea is to find the history of the job run using the program jobtrac. We use jobtrac's schedule to find the history of when job runs happened. We invoke jobtrac using
‘TSO JOBTRAC’ AND SUPPLY history command ‘H XXXXXX’ in the command line (XXXXX – jobname)
I was thinking to route the jobtrac info to a flat file and parse it so that I can do some reporting real time during the job run. The above problem is also linked to this following scenario:
If I give dslist 'DSLIST A.B.C.*'’ in the ISPF panel
It gives the series of datasets ...
A.B.C.A,
A.B.C.D
A.B.C.E
When I give
"SAVE ORANGE"
it stores this list under
MYUSERID.ORANGE.DATASETS.
I know this can be automated pro grammatically and I have seen that . But I don’t have the code base to do that right now. This is much similar to the jobtrack issue I have.
Here is some REXX CODE to help with understanding. I know this code is wrong…we cannot use outtrap for this as it is used to get console output.
say 'No. of month end jobs considered for history :'jobnames.0
if jobnames.0 > 0 then do
do i = 1 to jobnames.0
say jobnames.i
jobname = Word(jobnames.i,1);
say 'jobname under consideration is ' jobname;
tsocmd="JOBTRAC;ADDLOC=000;H "|| strip(jobname);
say 'tso command is ' tsocmd;
y = outtrap(jobdetails.)
Address TSO "'tsocmd'" ------------------> wrong…I believe I have to use ispexec
say 'job details are ' jobdetails.6;
end;

How do I Benchmark RESTful Service with Variable Parameters?

I'm currently working on benchmarking a RESTful service I've made, and part of that is making sure it runs in a reasonable amount of times for a large array of parameters. For example, let's say I have RESTful API of the form some_site.com/item?item_id=y. In that case to be sure my service is working as fast as I'd like it to work, I'd want to try out many values for y one by one, preferably coming from some text file. I can't figure out any way of doing this in ab or httperf. I'm open to using a different benchmarking program if I have, but would prefer something simple and light. What I want to do seems like something pretty standard, so I'm guessing there must already be a program that let's me do it, but an hour or so of googling hasn't gotten me an answer. Ideas?
Answer: Jmeter (which is apparently awesome). This faq explains how to do it. Hopefully this helps someone else, as it took me like a day of searching to figure this out.
I have just had some good experience with using JavaScript (via BSF/Rhino) in JMeter.
I have put one thread group in my test plan and stick a 'Simple Controller' with two elements under it - 'HTTP Request' sampler and 'BSF PreProcessor'.
Set BSF language to 'javascript' and either type the code into the text box or point it to a file (use full path or relative to CWD of JMeter process).
/* Since `Math.random()` gives us float, we use `java.util.Random()`
* see: http://docs.oracle.com/javase/7/docs/api/java/util/Random.html */
var Random = new Packages.java.util.Random();
var min = 10-1;
var max = 2;
var maxLines = (min)+Random.nextInt(max-min);
var s = '';
for (var d = 0; d <= maxLines; d++) {
s += d.toString()+','+Random.nextInt(1000).toString()+'\n';
}
// s => '0,312\n1,104\n2,608\n'
vars.put('PAYLOAD', s);
Now I can refer to ${PAYLOAD} in the HTTP request!
You can generate JSON, but you will need to upgrade jakarta-jmeter-2.5.1/lib/js-1.6R5.jar with the newest version of Rhino to get JSON.stringify and JSON.parse. That worked perfectly for me also, though I thought I'd put a simple example here.
You can use BSF pre-processor for URL params as well, just set another variable with vars.put('X', 'some value') and pass it as ${X} in the request parameter.
This blog post helped quite a bit, by the way.

Crystal Reports - Default Parameters

In Crystal reports, you can define default values for the report parameters.
For example, I might have a date range and set a default start of 12/01/2008 and a default end of 12/31/2008.
Is it possible to modify these defaults at runtime? For example:
1 - Default to the first and last days of the current month?
2 - Default to the first and last days of a proprietary company fiscal calendar? (i.e., look it up in a database)
3 - First & Last days of the current year?
You get the point. Is this possible? I'd even be open to a solution that involved running an external application to reach into the reports and modify them, if anyone knows how to do that.
Edit:
To answer the question posed by Philippe Grondier, most of these reports are run from inside an application. I was hoping for something simpler than manipulating the crystal object at runtime; I have my hands full right now with figuring out other parts of that API. I might take a look in the future, though.
Are you planning to run your crystal report from the crystal reports interface or as an add-in embedded in another program (you can for example use the Crystal Reports ActiveX Designer Runtime Support - craxdrt.dll - in VB code) ? In this last case, it is possible to manipulate every object of the report before launching it. Objects such as parameters can then be updated according to your needs.
As a simple example of such runtime update, my report printing routine will allways check if there is a field named "printedBy" in the report. In case this field is found, its value will be settled to the the domain name of the user that requests the report and will be printed out.
At an higher level, you can even reshape the report SQL string to add specific filters that can be inherited from your code. By doing so you might not even need parameters anymore: let your code add the filtering values 'on the fly'
EDIT: some code examples:
(m_rapport is a CRAXDRT.report object, ActiveSession is my current session object)
If m_rapport.ParameterFields.Count > 0 Then
For i = 1 To m_rapport.ParameterFields.Count
If m_rapport.ParameterFields(i).Name = "{?PUB_DateDebutPeriode}" Then
m_rapport.ParameterFields(i).AddCurrentValue CDate(DateValue(sessionActive.dateDebutPeriode))
End If
If m_rapport.ParameterFields(i).Name = "{?PUB_DateFinPeriode}" Then
m_rapport.ParameterFields(i).AddCurrentValue CDate(DateValue(sessionActive.dateFinPeriode))
End If
If m_rapport.ParameterFields(i).Name = "{?PUB_id_Personne}" Then
m_rapport.ParameterFields(i).AddCurrentValue StringFromGUID(clientActif.id_Personne)
End If
Next i
Endif
I also have another function to change report's datasource at runtime, so that reports can be executed on different servers/locations.
Read my posting Crystal Reports: Named-Date-Range Parameters. Maybe you'll be able to leverage this technique for your purposes.