You are not logged in.

#1 2017-09-15 01:29:33

Doug
Member
Registered: 2017-08-11
Posts: 72

How to use Conditionals?

How to use conditional in nanodlp?
Like if, else , while, etc...
for exemple;

if Z current position < 0
set Z = 0

Thanks

Offline

#2 2017-09-15 05:30:47

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: How to use Conditionals?

[[PositionSet {([[CurrentPosition]]>0)*[[CurrentPosition]]}]]

It changes all negative positions to zero.

Offline

#3 2017-09-27 16:32:57

Doug
Member
Registered: 2017-08-11
Posts: 72

Re: How to use Conditionals?

I need this for movements less than 0 and I need for movements more than 128

if Z current position < 0
set Z = 0
and
if Z current position > 128
set Z = 128
How to do it?

Offline

#4 2017-09-28 05:13:46

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: How to use Conditionals?

[[PositionSet {([[CurrentPosition]]>0)*[[CurrentPosition]]}]]
[[PositionSet {([[CurrentPosition]]<128)*[[CurrentPosition]]+([[CurrentPosition]]>128)*128}]]

Offline

#5 2017-09-28 13:11:59

Doug
Member
Registered: 2017-08-11
Posts: 72

Re: How to use Conditionals?

Thanks

Offline

#6 2017-09-28 23:09:39

Doug
Member
Registered: 2017-08-11
Posts: 72

Re: How to use Conditionals?

Another question, I don't want to make another thread
Whats the placeholder for Pinter Name, last Plate Name, last Print Time and last Resin Usage?

Offline

#7 2017-09-29 07:00:43

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: How to use Conditionals?

There is no access to named fields from gcode box. It will slow done gcode box processing so only limited number of fields are accessible from gcode boxes.
Workaround is to call external script from gcode box and from there you can have access to all variables by sending requests to different URL on nanodlp such as /status

Offline

#8 2017-09-29 10:47:02

Doug
Member
Registered: 2017-08-11
Posts: 72

Re: How to use Conditionals?

I want this placeholders to use on Execute at end. to send notifications via pushbullet.

Offline

#9 2017-10-13 13:07:34

Doug
Member
Registered: 2017-08-11
Posts: 72

Re: How to use Conditionals?

how can I get this formula to work?


(([[LayerNumber]] <=  5) * ([[SupportCureTime]] * 1) )
+
(([[LayerNumber]] <= 10) * ([[SupportCureTime]] * 0.75))
+
(([[LayerNumber]] <= 15) * ([[SupportCureTime]] * 0.50))
+
(([[LayerNumber]] <= 20) * ([[SupportCureTime]] * 0.25))
)

but if [[SupportCureTime]] <  [[CureTime]] use [[CureTime]]

Offline

#10 2017-10-13 13:21:37

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: How to use Conditionals?

You can use [[Net]] keyword to send pushbullet.

You should use {} to cover whole section which contains conditional or math to make it works.

Offline

#11 2017-10-13 13:38:34

Doug
Member
Registered: 2017-08-11
Posts: 72

Re: How to use Conditionals?

Shahin wrote:

You can use [[Net]] keyword to send pushbullet.

You should use {} to cover whole section which contains conditional or math to make it works.

Thanks

how about the part ;
if [[SupportCureTime]] <  [[CureTime]] use [[CureTime]]

Offline

#12 2017-10-13 15:43:41

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: How to use Conditionals?

{ ([[CureTime]] <  [[SupportCureTime]]) * [[CureTime]] }

Offline

#13 2017-10-13 18:05:40

Doug
Member
Registered: 2017-08-11
Posts: 72

Re: How to use Conditionals?

I tried this didnt work
{(  (([[LayerNumber]] <=  5) * ([[SupportCureTime]] * 1) )+(([[LayerNumber]] <= 10) * ([[SupportCureTime]] * 0.75))+(([[LayerNumber]]<= 15) * ([[SupportCureTime]] * 0.50))+(([[LayerNumber]] <= 20) * ([[SupportCureTime]] * 0.25)))+ ([[CureTime]] <=  [[SupportCureTime]]) * [[CureTime]] )}

Error
Math issue ((14 <= 5) * ([[SupportCureTime]] * 1) )+((14 <= 10) * ([[SupportCureTime]] * 0.75))+((14 <= 15) * ([[SupportCureTime]] * 0.50))+((14 <= 20) * ([[SupportCureTime]] * 0.25)) + ([[CureTime]] < [[SupportCureTime]]) * [[CureTime]]) -1 Invalid token ‘[’

Offline

#14 2017-10-13 21:36:19

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: How to use Conditionals?

As you see, [[CureTime]] and [[SupportCureTime]] are not replaced. I have checked out code. We do not support neither keywords.

Offline

#15 2017-10-16 13:53:57

Doug
Member
Registered: 2017-08-11
Posts: 72

Re: How to use Conditionals?

What you suppose to use in dynamic cure times?

Offline

#16 2017-10-16 18:43:04

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: How to use Conditionals?

Mostly current layer, largest/smallest area and etc.

Offline

Board footer

Powered by FluxBB