Where to place *.sci and *.cos files? - Blink.zip (0/1) - AND.cos (0/1)

Where to place *.sci and *.cos files? - Blink.zip (0/1) - AND.cos (0/1)

Post by Paul Rose » Thu, 10 Jan 2008 12:04:39

PLC-Simulators do not have this events, because the polling frequency
of switches depends on the microcontroller, where the application will
run last. But at the moment lets not pay attention to that point.

The last steps would be to compile that application to C-code, then
adapt the outcoming to the special requirements of the microcontroller
and last compile it with the microntrollers C-Compiler to a runable

To concentrate on this process, the programm should be as easy as
possible. Thus I chose, that the microcontroller should simply work as
an AND-Gate with two switches at two inputs and an LED at one outputs.
Thats all. I have tested AND Gate (Logical-Op) successful in Scicos
with the radio-buttons and the Affich-m block, which are only for
testing-purpose and thus can be removed. Thus the only remaining block
is the AND-Gate.

Now: How can I translate this (AND) Programm from Scicos into "C"

I would expect a very simple C-outcoming, something like
VarOut = VarIn1 && VarIn2.

Malheureu *** t je ne peux pas attach any programm in this newsgroup.

Where to place *.sci and *.cos files? - Blink.zip (0/1) - AND.cos (0/1)

Post by Ramine Nik » Thu, 10 Jan 2008 21:58:10

You can also use the "Logical" block. You simply have to give the truth
table associated with the "and" operation (I think it is the default

I dont see what you mean. The Logical Op block is already a C code. The
interfacing function is in scilab but the simulation code used for
simulation and code generation is in C. See for example the
logicalop_i16.c for the case of 16bit integer data types.

If you want a simple code like this, just wirte your own code.
logicalop_i16.c is complex because it works in vector case as well. If
you want a purely scalar code, just simplify logicalop_i16.c for your
specific application.

You can send it directly to my email address.


Ramine Nikoukhah