Search found 161 matches

by alanwms
Wed Aug 26, 2026 12:25 am
Forum: General
Topic: Question regarding the switch function, and a thought
Replies: 6
Views: 1159

Re: Question regarding the switch function, and a thought


If you mean the Switch command icon, then not exactly. That said, you can create a set of constants with appropriate names and unique integer values, and then use those throughout your project. These could then be used in a Switch statement and would be make the code a lot more readable and easy ...
by alanwms
Tue Aug 25, 2026 11:25 pm
Forum: General
Topic: Macro calling
Replies: 11
Views: 513

Re: Macro calling

@mnfisher I'm not sure of the syntax for c so could you help me with your example:
void (*fn)(MX_UINT32);
fn = (void*)FCL_MACRO_TABLE[FCL_I % 2];
fn(FCL_I);

I think this is what I need. I simply want to pick a macro from my table and run it. I'm using FC9
My table calling macros by one letter only ...
by alanwms
Sun Aug 23, 2026 4:09 pm
Forum: General
Topic: Macro calling
Replies: 11
Views: 513

Re: Macro calling

I can call you the macro but I have to add FCM_ at the beginning. My macro names are in the array table so I want to collect that macro name and call it. I'm not sure how to concatenate the FCM_ to the called name.
Thoughts?
by alanwms
Sat Aug 22, 2026 10:49 pm
Forum: General
Topic: Macro calling
Replies: 11
Views: 513

Re: Macro calling

Thanks. I'm now clarified...
by alanwms
Sat Aug 22, 2026 8:34 pm
Forum: General
Topic: Macro calling
Replies: 11
Views: 513

Re: Macro calling

I got the system running with the switch. The code is bulky with quite a few decisions.. I figured matching the command with a table list would make the code easier and more efficient.
by alanwms
Sat Aug 22, 2026 5:44 pm
Forum: General
Topic: Macro calling
Replies: 11
Views: 513

Macro calling

I would like to call a macro based on a table entry. So if I select table_string[7] which indicates the value of "macro1" for instance, I would like to call macro1.
Currently, calling a macro is singular and not based on a variable finding. Do I need C for this? I can't simulate C in my simulator ...
by alanwms
Fri Jul 31, 2026 9:58 pm
Forum: General
Topic: Question regarding the switch function, and a thought
Replies: 6
Views: 1159

Re: Question regarding the switch function, and a thought

The attached helped but - - I can get the if block to work but my switch simply falls through
Untitled.jpg
Untitled.jpg (55.53 KiB) Viewed 973 times
by alanwms
Wed Jul 29, 2026 3:54 pm
Forum: General
Topic: Question regarding the switch function, and a thought
Replies: 6
Views: 1159

Question regarding the switch function, and a thought

Is it possible to use a string for the switch function?

Thought:
Such a simple idea, but it would be nice to incorporate either automatic or manual file backups.
by alanwms
Thu Jul 09, 2026 6:09 pm
Forum: General
Topic: PWM Woes
Replies: 19
Views: 16674

Re: PWM Woes

Did we resolve this?
by alanwms
Mon Feb 16, 2026 1:48 pm
Forum: General
Topic: 16f18877 internal Zero Cross Detector
Replies: 24
Views: 11600

Re: 16f18877 internal Zero Cross Detector

Maybe an easier method would be to simply connect a dual optical isolator via resistor directly to the micro controller transformer on the secondary ac side. Your open collector outputs will switch at every zero crossing.
That signal is connected to the hardware interrupt which services the routine ...