开云体育

More syntax issues with 24.1.x


 

开云体育

I have many testjigs that import digitised datasheet characteristic curves. An example of this would be:

.subckt IB_400u 1 2 3 4
R1 3 4 1G
B1 1 2 I=table(V(3,4)
.inc BC848B_Ic_Vce_400u.inc
+)

This is used with a G-source called IB_400u, which in this case is the? Ic vs. Vce characteristic of a transistor, i.e.:

XG1 C 0 C 0 IB_400u

The file BC848B_Ic_Vce_400u.inc is a simple table:

+, 0, 0
+, 0.033713692946058194, 0.0037373737373737337
+, 0.07139456405596434, 0.007119195585620269
+, 0.09937242651150191, 0.01031229370884544
+, 0.11993258152246877, 0.014095645315621533
etc.


This has always worked since LTspiceIV. With 24.1.4, it no longer works. Apparently, the new syntax checker works line by line, therefore the line:

B1 1 2 I=table(V(3,4)

..will fail due to unbalanced parentheses. There seems to be no workaround that I have yet been able to figure, as the .inc directive must appear at the start of a line.

I have uploaded example schematic to illustrate this issue: OP_Characteristic_rounding.

This issue seems to be related to the previously reported issue with nested .STEP directives of the form:

.step param A? 0 10 1
+ param B list 1 2 5 10

..where the 2nd line is failing with 24.1.x. Example schematic uploaded: LTspice_24.1_Step_problem.

--
Regards,
Tony


 

On Tue, Mar 4, 2025 at 12:06 PM, Tony Casey wrote:
I have many testjigs that import digitised datasheet characteristic curves. An example of this would be:

.subckt IB_400u 1 2 3 4
R1 3 4 1G
B1 1 2 I=table(V(3,4)
.inc BC848B_Ic_Vce_400u.inc
+)

The file BC848B_Ic_Vce_400u.inc is a simple table:

+, 0, 0
+, 0.033713692946058194, 0.0037373737373737337
+, 0.07139456405596434, 0.007119195585620269
+, 0.09937242651150191, 0.01031229370884544
+, 0.11993258152246877, 0.014095645315621533
etc.
Yes, this won't work anymore. Prior versions pre-process the input and replace the .include line with the contents of the included file and then parse everything all over again. 24.1 is very different, it doesn't accept a top-level directive in the middle of something.
But you don't actually need such general behavior, all you want is to load data from another file, and that's certainly useful. How about extending the table syntax:
?
B1 1 2 I=table(V(3,4), "BC848B_Ic_Vce_400u.inc")
?
This would be easy to do. You'd still have to modify your netlists, though.

This issue seems to be related to the previously reported issue with nested .STEP directives of the form:

.step param A? 0 10 1
+ param B list 1 2 5 10

..where the 2nd line is failing with 24.1.x. Example schematic uploaded: LTspice_24.1_Step_problem.
?
This should work and does work for me if I try, but you obviously have a case where it doesn't. Unfortunately, you uploaded the wrong file. I'd appreciate a netlist or schematic.
?
Best Regards,
Mathias
?


 

开云体育

On 04/03/2025 13:14, Mathias Born via groups.io wrote:
Yes, this won't work anymore. Prior versions pre-process the input and replace the .include line with the contents of the included file and then parse everything all over again. 24.1 is very different, it doesn't accept a top-level directive in the middle of something.
But you don't actually need such general behavior, all you want is to load data from another file, and that's certainly useful. How about extending the table syntax:
?
B1 1 2 I=table(V(3,4), "BC848B_Ic_Vce_400u.inc")
No, that doesn't work, either, in any version.

U:\Simulations\LTspice\Modelling_Bipolar\BC847_BC857\OP_Characteristic_rounding.net(17): Invalid number of arguments.
B1 1 2 I=table(V(3,4) "BC848B_Ic_Vce_400u.inc" )
?????????????? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
With or without a comma between "V(3,4)" & "BC848B_Ic_Vce_400u.inc" the same error results. Doesn't look like the file is being included.

Even if this did work, I have hundreds of instances like this. It's a lot less pain to stick with 24.0.12.

--
Regards,
Tony


 

On Tue, Mar 4, 2025 at 01:53 PM, Tony Casey wrote:
On 04/03/2025 13:14, Mathias Born via groups.io wrote:
Yes, this won't work anymore. Prior versions pre-process the input and replace the .include line with the contents of the included file and then parse everything all over again. 24.1 is very different, it doesn't accept a top-level directive in the middle of something.
But you don't actually need such general behavior, all you want is to load data from another file, and that's certainly useful. How about extending the table syntax:
?
B1 1 2 I=table(V(3,4), "BC848B_Ic_Vce_400u.inc")
No, that doesn't work, either, in any version.

Even if this did work, I have hundreds of instances like this. It's a lot less pain to stick with 24.0.12.
Sorry, that was a misunderstanding. The above syntax was a proposal for a future change. This is about a compromise. The old way can't come back. I'm open for suggestions.
And modifying all those netlists could be done in one go with grep. (Or much better, with
?
Best Regards,
Mathias
?


 

Hi Tony,
?
The next update 24.1.6 will support this again.
?
The official syntax for loading table data from a file will be:
?
table(x, .include "<filename>")
?
but yours will also work as is. You will also need not change the file contents, however the "+" line continuation at the start of each line will be optional and can be omitted.
?
This is a good feature, and now it's official.
?
Best Regards,
Mathias
?
On Tue, Mar 4, 2025 at 12:06 PM, Tony Casey wrote:

I have many testjigs that import digitised datasheet characteristic curves. An example of this would be:

.subckt IB_400u 1 2 3 4
R1 3 4 1G
B1 1 2 I=table(V(3,4)
.inc BC848B_Ic_Vce_400u.inc
+)


 

开云体育

On 12/03/2025 13:17, Mathias Born via groups.io wrote:
Hi Tony,
?
The next update 24.1.6 will support this again.
?
The official syntax for loading table data from a file will be:
?
table(x, .include "<filename>")
?
but yours will also work as is. You will also need not change the file contents, however the "+" line continuation at the start of each line will be optional and can be omitted.
?
This is a good feature, and now it's official.
?
Best Regards,
Mathias
?
On Tue, Mar 4, 2025 at 12:06 PM, Tony Casey wrote:
I have many testjigs that import digitised datasheet characteristic curves. An example of this would be:

.subckt IB_400u 1 2 3 4
R1 3 4 1G
B1 1 2 I=table(V(3,4)
.inc BC848B_Ic_Vce_400u.inc
+)
Great! I look forward to 24.1.6.

--
Regards,
Tony